Skip to main content
Spartaneity
Participant
March 10, 2018
Answered

check/force multiple of 10 for entry in a form field

  • March 10, 2018
  • 1 reply
  • 479 views

Trying to set up a form field that only accepts multiples of 10 by using custom validation script.

I tried this without success...

Math.ceil(event.value / 10) * 10;

I'm a newbie at this so any help is appreciated.

Thanks!

This topic has been closed for replies.
Correct answer try67

Use this as the field's custom validation script:

if (event.value && Number(event.value)%10!=0) {

    app.alert("You must enter a multiple of 10.");

    event.rc = false;

}

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 10, 2018

Use this as the field's custom validation script:

if (event.value && Number(event.value)%10!=0) {

    app.alert("You must enter a multiple of 10.");

    event.rc = false;

}

Spartaneity
Participant
March 10, 2018

Thanks for the quick reply - it works perfectly!

Thank you!