Results 1 to 6 of 6

Thread: Set textbox length

  1. #1
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658

    Set textbox length

    Hello,

    If I have a textbox in a canvas section, how would I set the maximum character length for the textbox?

    For example, a textbox is used for someone's full name. The associated table has a max length of 30 for that field.
    How can I set that textbox so that no more than 30 characters are entered?

    Cory

  2. #2
    Hi Cory,

    One way is to go the field attributes and put 30 capitial A's in the input mask.

    There's probably a better way, but that should work.

    Herb

  3. #3
    Unless you also need a number, then 30 capital Z's.

  4. #4
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hi Herb,

    I had thought of that but I can't see that being the best solution, especially if the length would be even higher.
    In addition, if you already have another input mask set, this may create conflicts.

    I've also thought of using an edit box; however, the same situation exists ... how do I set the maximum length?

    Cory

  5. #5
    Corey,

    Another way is would be to put some code in the interactive event of the textbox and check the length using len().

    Then just handle it programmatically

    otext= Lianja.get("page1.section2.field1").text
    olen = len(otext.text)

    if olen <= 30

    //do whatever

    Endif

    Herb

  6. #6
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Excellent suggestion.

    Just one correction:
    olen = len(otext)

    Thank Herb.

    If anyone else has another suggestion, feel free to let me know.

    Cory

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us