how to make checkboxs field as mandatory in form section?

Aryan
Tera Contributor

Hi All,

 

We have a form section where we have 6 checkbox fields and our requirement is to make it mandatory on before resolving the incident, if any of the one choice is selected then incident can be closed but if all 6 are uncheck then it should give a pop to select any one checkbox from the form section.

 

anyone help me on this!!

 

 

1 REPLY 1

Ashutosh C J
Tera Guru

Hi @Aryan 
Please use an onSubmit client script. Check this out

 

function onSubmit() {	
       //Use && and add all your 6 check box fields inside if loop
	if(g_form.getValue("u_mandatory_check") == "false" && g_form.getValue("u_mandatory_check_2") == "false"){		
		g_form.addErrorMessage("Please select any one checkbox field");
		return false;
	}
	else
	return true;
}

 

AshutoshCJ_0-1714745649536.png

AshutoshCJ_1-1714745685072.png

Please mark my solution as accepted or helpful to help the community better