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

Conditionally required fields

Explorer ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

I have two similar questions;

1.  I would like to make fields in my form required based on the value entered in another field.  i.e. field a > 10 then field b is required

2.  Alternately, I would like to make field d required if there is any value in field c

Thank you ahead of time for your help.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

639

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 , Feb 27, 2018 Feb 27, 2018

As the custom validation of field "a" enter:

this.getField("b").required = Number(event.value)>10;

As the custom validation of field "c" enter:

this.getField("c").required = (event.value!="");

Votes

Translate

Translate
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

LATEST

As the custom validation of field "a" enter:

this.getField("b").required = Number(event.value)>10;

As the custom validation of field "c" enter:

this.getField("c").required = (event.value!="");

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