Limiting the number of values that could be input in a form field
19 views
Skip to first unread message
mostwanted
unread,
Dec 8, 2021, 2:23:01 PM12/8/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Is there a validator that could be used to limit the number of values that could be submitted in a form field? I want users to input their ID numbers but they cant be more than 9 characters, how do i achieve this?
Clemens
unread,
Dec 8, 2021, 2:35:17 PM12/8/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
I didn't test it, but this should do the job:
requires = IS_MATCH('^\w{1,9}$', error_message='must be 1 to 9 characters/digits')
For further information about validators with regular expressions have a look here: