Skip to main content
Participant
August 4, 2022
Question

How to make a dropdown menu and 2 text fields required based on dropdown menu option of Yes?

  • August 4, 2022
  • 1 reply
  • 217 views

How do you make another dropdown menu response and 2 text fields to be required if the 1st dropdown menu answer is yes. So, if someone answers "Yes" to a third party being involved, we need the next dropdown menu to be required, as well as 2 text fields to be required. Any help would be greatly appreciated.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 4, 2022

You didn't specify the names of the fields involved, so I will give you a generic script that you will need to adjust with the actual field names. As the custom Validation script of the first drop-down you can use the following:

 

if (event.value=="Yes") {
	this.getField("Dropdown1").required = true;
	this.getField("Text1").required = true;
	this.getField("Text2").required = true;
} else {
	this.getField("Dropdown1").required = false;
	this.getField("Text1").required = false;
	this.getField("Text2").required = false;
}