Skip to main content
Participant
April 10, 2020
Frage

Script ofr Length of field

  • April 10, 2020
  • 2 Antworten
  • 427 Ansichten

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.

 

Dieses Thema wurde für Antworten geschlossen.

2 Antworten

MST1552Autor
Participant
April 11, 2020

Thank you very much 

try67
Community Expert
Community Expert
April 11, 2020

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.

 

Inspiring
June 22, 2020

thank you