• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Mar 10, 2018 Mar 10, 2018

Copy link to clipboard

Copied

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!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

305

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 10, 2018 Mar 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;

}

Votes

Translate

Translate
Community Expert ,
Mar 10, 2018 Mar 10, 2018

Copy link to clipboard

Copied

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;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 10, 2018 Mar 10, 2018

Copy link to clipboard

Copied

LATEST

Thanks for the quick reply - it works perfectly!

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines