Skip to main content
Sandi24085460uv6l
Participant
April 18, 2022
Question

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

  • April 18, 2022
  • 1 reply
  • 630 views

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!

 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
April 18, 2022

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;