Copy link to clipboard
Copied
I have the following form scenario I need assistance solving with Javascript.
If a user enters a serial number in one field then they are required to answer five other text fields. If no data is entered in that serial number field than those fields aren't required.
Thanks Claire
You can use this code as Custom validation or calculation script:
this.getField("Text1").required = event.value == "" ? false : true;
this.getField("Text2").required = event.value == "" ? false : true;
this.getField("Text3").required = event.value == "" ? false : true;
this.getField("Text4").required = event.value == "" ? false : true;
this.getField("Text5").required = event.value == "" ? false : true;
Change field names to your field names.
Copy link to clipboard
Copied
You can use this code as Custom validation or calculation script:
this.getField("Text1").required = event.value == "" ? false : true;
this.getField("Text2").required = event.value == "" ? false : true;
this.getField("Text3").required = event.value == "" ? false : true;
this.getField("Text4").required = event.value == "" ? false : true;
this.getField("Text5").required = event.value == "" ? false : true;
Change field names to your field names.