Skip to main content
Allison Hetrick
Participating Frequently
March 7, 2023
Question

Making Fields Required Based on Entry in a Field

  • March 7, 2023
  • 1 reply
  • 432 views

I want to make it where if some enters text into one field, it makes a handful of fields following it required. If no text is entered, the fields remain not required.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 7, 2023

You can use this code as the custom Validation script of the main field:

 

var otherFields = ["Text1", "Text2", "Text3"]; // replace with actual field names
for (var i in otherFields) {
	this.getField(otherFields[i]).required = (event.value!="");
}