Explore the community Forums Lectora Lectora Questions & Answers All letters uppercase except last one

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #388508 Score: 0
    Profile photo of Rebecca Sepeda
    Rebecca Sepeda
    Member
    beginner
    intermediate
    friend finder
    Group Member
    LUC17 Attendee
    curious george
    wise owl
    contributor
    3 pts
    @rsepeda7427

    I am trying to make my entry field convert to uppercase, but when I click on the button, my results have everything uppercase except the last letter. On my entry field, my Action is: “Select/Change”, “Run JavaScript”

    document.getElementById(“entry60id”).value =
    document.getElementById(“entry60id”).value.toUpperCase();

    Can anyone assist me on making ALL letters uppercase?

    #388520 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    You can use CSS instead of javascript. Add an external html object of the type Meta tag and insert this:

    <style>
    input{
    text-transform: uppercase;
    }
    </style>
    

    This way the entry field will only ever display uppercase instead of changing it after input.

    The CSS above will change all input fields, but you can replace “input” with “#entry60id” if you only want to change that one entry field.

    Then use javascript to change the variable to uppercase as well. Add an action to the field:
    On: Show
    Action: Run javascript
    Javascript:

    el = document.getElementById("%HTMLNAME%id");
    el.onkeyup = function(evt) {
    VarEntry_0001.set(el.value.toUpperCase());
    };
    #388522 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    Mind you may have to change the variable name.

    #388545 Score: 0
    Profile photo of Rebecca Sepeda
    Rebecca Sepeda
    Member
    beginner
    intermediate
    friend finder
    Group Member
    LUC17 Attendee
    curious george
    wise owl
    contributor
    3 pts
    @rsepeda7427

    When I hit the “Click” button, my “Results” text box is still lowercase.

    Attachments:
    #388578 Score: 1
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    Here’s a sample

    This post has received 1 vote up.
    Attachments:
    1. Uppercase.zip
    #388583 Score: 0
    Profile photo of Rebecca Sepeda
    Rebecca Sepeda
    Member
    beginner
    intermediate
    friend finder
    Group Member
    LUC17 Attendee
    curious george
    wise owl
    contributor
    3 pts
    @rsepeda7427

    Perfect! Thank You

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.