Skip to main content
Correct answer try67

OK. Here's how I would do it. Define both fields as required and then use the following custom validation script in each one:

this.getField("Name of other field").required = (event.value=="");

event.target.required = true;

1 reply

try67
Community Expert
Community Expert
March 15, 2019

"Require" in what sense, exactly?

libbywblanton
Participant
March 15, 2019

The same way that you can make a single field "required," I'd like to apply that to two fields but just require that one or the other is completed. It's actually for a W-4 that we're having new hires at our company complete, and we need to ensure that they either put in a withholding amount OR they complete the "Exempt" box.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 15, 2019

OK. Here's how I would do it. Define both fields as required and then use the following custom validation script in each one:

this.getField("Name of other field").required = (event.value=="");

event.target.required = true;