How Do I Set Form Field =Required property ONLY if another field is filled?

New Here ,
Apr 18, 2022 Apr 18, 2022

Copy link to clipboard

Copied

I have a form where I would like to set the field required property ONLY if another field is filled (specifically if someone enters data listing a serial # for a one of the units, all pass fail data for that unit becomes required) There are multiple units that can have data on a form, but not all WILL have data based on test set up, so I cannot make all fields required.

 

Thanks!

 

TOPICS
How to

Views

64

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
community guidelines
Adobe Community Professional ,
Apr 18, 2022 Apr 18, 2022

Copy link to clipboard

Copied

LATEST

Lets say you want to set "field2" required if "field1" is filled, use this as 'Validation' script of "field1" and change name of the "field2" to your actual name:

this.getField("field2").required = event.value == "" ? false : true;

 

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
community guidelines