Skip to main content
Allison Hetrick
Participating Frequently
Mar 7, 2023 10:39 PM UTC
Question

Making Fields Required Based on Entry in a Field

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 is closed to new replies. Start a new post to keep the conversation going.

1 reply

try67
Community Expert
Community Expert
Mar 7, 2023 10:59 PM UTC

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