-
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
-
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
-
Unless you also need a number, then 30 capital Z's.
-
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
-
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
-
Excellent suggestion.
Just one correction:
olen = len(otext)
Thank Herb.
If anyone else has another suggestion, feel free to let me know.
Cory
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks