Conditionally required fields

Explorer ,
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.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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!="");

TOPICS
Acrobat SDK and JavaScript, Windows

Views

258

Likes

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

Conditionally required fields

Explorer ,
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.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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!="");

TOPICS
Acrobat SDK and JavaScript, Windows

Views

259

Likes

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
Feb 27, 2018 0
Most Valuable Participant ,
Feb 27, 2018

Copy link to clipboard

Copied

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!="");

Likes

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
Reply
Loading...
Feb 27, 2018 0