Integer Validator, Max Digits v. Max Length

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Joe Blake
Ebase User
Posts: 44
Joined: Sun Sep 15, 2013 6:26 pm

Integer Validator, Max Digits v. Max Length

#1

Postby Joe Blake » Fri Sep 27, 2013 4:07 am

I have a field in the tutorial, CDS-CD_ID with the following parameters in Properties:

Field Type: Integer
Validator: Max Digits 10
Max Length 17

Is there a conflict here?

Which one takes precedence?
0 x
New Potential User.

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Fri Sep 27, 2013 8:00 am

The two validators work slightly differently:

Max length: sets the length of the input field and restricts the number of characters you can enter.
Max Digits: checks the input when you submit the form and issues a message

So with these settings you could type up to 17 characters but only inputs up to 10 digits will be posted.
0 x

Joe Blake
Ebase User
Posts: 44
Joined: Sun Sep 15, 2013 6:26 pm

max length, max digits

#3

Postby Joe Blake » Fri Sep 27, 2013 1:55 pm

Example 1

Max Length=3
Max Digits=5

You are allowed to enter 12345
What will be shown is 12345
What will be posted to db 123

Example 2:

Max Length=5
Max Digits=3

You are allowed to enter 123
What will be shown is 123
What will be posted to db 123
0 x
New Potential User.

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Fri Sep 27, 2013 3:15 pm

Well that's a surprise and not what I was expecting. Example 2 sounds OK but example 1 doesn't. If I try this on my system, I can only enter 3 characters - but my starting point is an empty input box. If you start off with a value which is longer than max length e.g. you've loaded it from a database, the browser will display it, but then it won't let you submit it. I think that might be what you're seeing. Also if you remove the characters in the browser, you will then only be able to enter 3 characters (max length).
0 x


Who is online

Users browsing this forum: No registered users and 15 guests