Hi. If anyone could help me I would greatly appreciate it. I have some code that I would like to know how to condense. Here is a sample of what I have:
if (event.target.value=="Off") {
this.getField("tfuinspection1").readonly = false;
this.getField("tfuinspection1").value = " ";
this.getField("tfuinspection2").readonly = false;
this.getField("tfuinspection2").value = " ";
this.getField("tfuinspection3").readonly = false;
this.getField("tfuinspection3").value = " ";
this.getField("tfuinspection4").readonly = false;
this.getField("tfuinspection4").value = " ";
this.getField("tfuvalue1").readonly = false;
this.getField("tfuvalue1").value = " ";
this.getField("tfuvalue2").readonly = false;
this.getField("tfuvalue2").value = " ";
this.getField("tfuvalue3").readonly = false;
this.getField("tfuvalue3").value = " ";
this.getField("tfuvalue4").readonly = false;
this.getField("tfuvalue4").value = " ";
this.getField("tfuvalue5").readonly = false;
this.getField("tfuvalue5").value = " ";
this.getField("tfuvalue6").readonly = false;
this.getField("tfuvalue6").value = " ";
} else {
this.getField("tfuinspection1").readonly = true;
this.getField("tfuinspection1").value = "N/A";
this.getField("tfuinspection2").readonly = true;
this.getField("tfuinspection2").value = "N/A";
this.getField("tfuinspection3").readonly = true;
this.getField("tfuinspection3").value = "N/A";
this.getField("tfuinspection4").readonly = true;
this.getField("tfuinspection4").value = "N/A";
this.getField("tfuvalue1").readonly = true;
this.getField("tfuvalue1").value = "N/A";
this.getField("tfuvalue2").readonly = true;
this.getField("tfuvalue2").value = "N/A";
this.getField("tfuvalue3").readonly = true;
this.getField("tfuvalue3").value = "N/A"
this.getField("tfuvalue4").readonly = true;
this.getField("tfuvalue4").value = "N/A"
this.getField("tfuvalue5").readonly = true;
this.getField("tfuvalue5").value = "N/A"
this.getField("tfuvalue6").readonly = true;
this.getField("tfuvalue6").value = "N/A"
}
I would like to know how to write it so it is more condensed then having to write out each form field that I have on my document. These are for when a checkbox is checked to N/A multiple form fields. Some are text fields and some are dropdown menus. Thanks for anyone that helps out.
if (event.target.value=="Off") {
this.getField("tfuinspection1").readonly = false;
this.getField("tfuinspection1").value = " ";
this.getField("tfuinspection2").readonly = false;
this.getField("tfuinspection2").value = " ";
this.getField("tfuinspection3").readonly = false;
this.getField("tfuinspection3").value = " ";
this.getField("tfuinspection4").readonly = false;
this.getField("tfuinspection4").value = " ";
this.getField("tfuvalue1").readonly = false;
this.getField("tfuvalue1").value = " ";
this.getField("tfuvalue2").readonly = false;
this.getField("tfuvalue2").value = " ";
this.getField("tfuvalue3").readonly = false;
this.getField("tfuvalue3").value = " ";
this.getField("tfuvalue4").readonly = false;
this.getField("tfuvalue4").value = " ";
this.getField("tfuvalue5").readonly = false;
this.getField("tfuvalue5").value = " ";
this.getField("tfuvalue6").readonly = false;
this.getField("tfuvalue6").value = " ";
} else {
this.getField("tfuinspection1").readonly = true;
this.getField("tfuinspection1").value = "N/A";
this.getField("tfuinspection2").readonly = true;
this.getField("tfuinspection2").value = "N/A";
this.getField("tfuinspection3").readonly = true;
this.getField("tfuinspection3").value = "N/A";
this.getField("tfuinspection4").readonly = true;
this.getField("tfuinspection4").value = "N/A";
this.getField("tfuvalue1").readonly = true;
this.getField("tfuvalue1").value = "N/A";
this.getField("tfuvalue2").readonly = true;
this.getField("tfuvalue2").value = "N/A";
this.getField("tfuvalue3").readonly = true;
this.getField("tfuvalue3").value = "N/A"
this.getField("tfuvalue4").readonly = true;
this.getField("tfuvalue4").value = "N/A"
this.getField("tfuvalue5").readonly = true;
this.getField("tfuvalue5").value = "N/A"
this.getField("tfuvalue6").readonly = true;
this.getField("tfuvalue6").value = "N/A"
}
I would like to know how to write it so it is more condensed then having to write out each form field that I have on my document. These are for when a checkbox is checked to N/A multiple form fields. Some are text fields and some are dropdown menus. Thanks for anyone that helps out.
Comment