Need to limit to 10 digit number

Johnson13
Tera Expert

I need to limit the field to 10 digit number. Here is my code. need assistance.

 

 

find_real_file.png

Thanks.

6 REPLIES 6

Jim Coyne
Kilo Patron

As Ankur mentions, the Validation Regex is the way to go AND I'd also use the "max_length" Variable attribute to limit them to 10 characters in the first place:

Setup the validation regex:

find_real_file.png

 

...and then setup your variable:

find_real_file.png

 

find_real_file.png

 

No coding.  Easy to use elsewhere.  Because you just know you will need it again.

Jim Coyne
Kilo Patron

Oh, and I'm sure the guys sending you code back would have appreciated it if you had actually pasted the code that you had tried instead of the screenshot.

Screenshots are good to show the configuration of things, but when it comes time for help with code...

TNT: Screenshots Help, but Code is Better

TNT: And Formatted Code is Even Better