Explore the community Forums Lectora Lectora Questions & Answers Display user entry in text entry box as upper case always

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #434484 Score: 0
    Profile photo of Maura T. Sullivan
    Maura T. Sullivan
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    profile
    1 pt
    @msullivan3430

    I’m working on a software simulation where the text in the text entry box (i.e., form entry field) should automatically be displayed as upper case only regardless of how it is entered.

    I’ve used the Debug view to verify that the following code is changing the user’s answer (variable is 07tebPayDate) to upper case. I need it to display as upper case in the form element. I don’t want to use a text block to create a fake text entry field if I can help it—this is because I need the user to be able to change the date if they enter it incorrectly.

    This is the code:

    var myString = Var07tebPayDate.getValue();
    alert(“myString = ” + myString);
    var upperString = myString.toUpperCase();
    alert(“upperString = ” + upperString);
    alert(Var07tebPayDate.getValue());
    Var07tebPayDate.set(upperString);

    I’ve also included a snip of the text entry box area.

    THANKS!

    Maura

    #434491 Score: 1
    Profile photo of Laura Silver
    Laura Silver
    Moderator
    junior moderator
    verified member
    beginner
    intermediate
    contributor
    wise owl
    friend finder
    advanced
    curious george
    Group Member
    22 pts
    @lsilver

    Hi Maura – I found this post worked well for me – hopefully it does the trick for you!

    https://community.trivantis.com/forums/topic/all-letters-uppercase-except-last-one/

    This post has received 1 vote up.
    #434493 Score: 0
    Profile photo of Maura T. Sullivan
    Maura T. Sullivan
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    profile
    1 pt
    @msullivan3430

    Thank you for helping me find that post AND many thanks to TIM K. for the original code!

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

You must be logged in to reply to this topic.