Copy link to clipboard
Copied
I have a question on a form with 2 checkboxes (YES or NO)
Depending upon the checkbox, I would like a script that will clear all the data in 3 specific fields.
If YES is checked, the focus moves to the next field. (This already works)
If NO is checked, clear all data in the 3 fields. (This is what I'm looking for.)
Copy link to clipboard
Copied
Use as 'Mouse UP' action of 'NO' checkbox and replace field names with your actual filed names:
if(event.target.isBoxChecked(0)){
this.getField("Field1").value = "";
this.getField("Field2").value = "";
this.getField("Field3").value = "";}
Copy link to clipboard
Copied
Use as 'Mouse UP' action of 'NO' checkbox and replace field names with your actual filed names:
if(event.target.isBoxChecked(0)){
this.getField("Field1").value = "";
this.getField("Field2").value = "";
this.getField("Field3").value = "";}
Copy link to clipboard
Copied
Thanks again Nesa.
I modified your suggestion to:
if (event.target.value == "NO") {
this.getField("Tobacco_Packs_per_day").value = "";
this.getField("Tobacco_years_usage").value = "";
this.getField("Tobacco_Quit_Date").value = "";}