Level 1
Level 2
Sign in to Community
Learn more
Sign in to view all badges
Expand my Community achievements bar.
How I can validate a field so the users enter the letter K(uppercase) and 7 digits.
Example: K1234567
Thank you
Hi,
you can use a regular expression in the change event of your field to restrict the input to the desired format (K9999999).
if (!xfa.event.fullText.match(/^[K]\d{0,7}$/g)) { xfa.event.change = "";}
if (!xfa.event.fullText.match(/^[K]\d{0,7}$/g)) {
xfa.event.change = "";
}
Hi Radzar,
I tried you script in the change event but for some reason does not allows me to enter any number into the field!
Field seems to be locked!
Views
Likes
Replies