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

Script that requires the user to type in "Y" or "N".

New Here ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

I am working in Acrobat Pro X1. and am designing a fillable form that has a column that requires the user to put either a "Y" or "N" only. (This may be changed to "P" or "F" pass or fail). I made an Arbitrary Mask with "A" and this works except that any alpha can be typed into the column. I know that this should be simple but I'm just not finding it.

Do I need to run a validation?  and if I do, what would that look like?

I would appreciate any help.

Thanks!

TOPICS
Acrobat SDK and JavaScript , Windows

Views

387

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 , May 03, 2018 May 03, 2018

OK, then you can use this code as the field's custom validation script:

if (event.value) event.rc = (event.value=="Y" || event.value=="N");

Votes

Translate

Translate
Community Expert ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

Why not use a drop-down field, instead?

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 ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

Normally that would work but there is only enough room for one character in the column. (Basically the drop-down is too big) Also, there are 28 lines in the column with text boxes on either side.

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
Community Expert ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

OK, then you can use this code as the field's custom validation script:

if (event.value) event.rc = (event.value=="Y" || event.value=="N");

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 ,
May 03, 2018 May 03, 2018

Copy link to clipboard

Copied

LATEST

Perfect! 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