Skip to main content
Participant
Apr 10, 2020 11:34 PM UTC
Question

Script ofr Length of field

I am new to this so I could use some help

 

I am trying to get the length of a field and if the field <>  9 product an error. like "your field has to be 9 charectors.

I have been searching and I can not find anything.

 

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

MST1552Author
Participant
Apr 11, 2020 2:45 PM UTC

Thank you very much 

Translate
try67
Community Expert
Community Expert
Apr 11, 2020 8:40 AM UTC

As the custom validation event of the field enter the following (I'm assuming you want to allow the user to clear the field):

 

if (event.value.length!=0 && event.value.length!=9) {
app.alert("You must enter 9 characters.");
event.rc = false;
}

 

Edit: Code fixed.

 

Translate
Inspiring
Jun 22, 2020 3:58 PM UTC

thank you

Translate