Copy link to clipboard
Copied
Hello,
I have two drop down boxe fields on my form. One is called Rejection1 and the other is called Disposition1 (both fields are NOT read-only by default). If the user filling out the form selects "Material Defect" in the Rejection1 field, i want the Disposition1 field to become read-only so it can't be filled out. If the user selects anything else in the Rejection1 field then the Disposition1 field should NOT be read-only.
Here's the validation field i have entered in the Rejection1 field but am obviously missing something as no matter what i select in the Rejection1 field, the Disposition1 field is made as read-only. Can someone help me with this?
if (event.value = "Material Defect") (this.getField("Disposition1").readonly = true);
else (this.getField("Disposition1").readonly = false);
i've also tried:
if (event.value = 'Material Defect') (this.getField("Disposition1").readonly = true);
else (this.getField("Disposition1").readonly = false);
Thank you!
Change the first line to:
if (event.value == "Material Defect")
Try this code:
if (event.value == "Material Defect") {
this.getField("Disposition1").readonly = true;
this.getField("Disposition1").value = "QC Check";
} else {
this.getField("Disposition1").readonly = false;
}
Copy link to clipboard
Copied
Change the first line to:
if (event.value == "Material Defect")
Copy link to clipboard
Copied
Thank you! That worked! - One other related question. Is there a way i can add to that script so that if "Material Defect" is chosen in the Rejection1 field then "QC Check" is automatically chosen in the Disposition1 field AND the Disposition1 field is marked as read only as we now have it working from the script?
Here's what my current validation script for the Rejection1 field looks like since applying your fix:
if (event.value == "Material Defect") (this.getField("Disposition1").readonly = true);
else (this.getField("Disposition1").readonly = false);
Thanks!
Copy link to clipboard
Copied
Try this code:
if (event.value == "Material Defect") {
this.getField("Disposition1").readonly = true;
this.getField("Disposition1").value = "QC Check";
} else {
this.getField("Disposition1").readonly = false;
}
Copy link to clipboard
Copied
Perfect! That worked, thank you very much!!