Hi, I'm not sure if I should ask this question in this forum or use the Adobe Javascript forum. I have a form that needs to have a javascript in it. I have Adobe Acrobat X. What I need it to do is this:
If a user entered a Posted Speed in the Text Field, the Check box for Prima Fascia cannot be selected. The same goes the other way, if someone checks the Prima Fascia check box, then nothing can be entered into the Posted Speed Text Field.
Is there a javascript that can be used for this? Thanks for your assistance.
Connie Bretes
I would use the "Mouse Up" action for the check box and set the readonly property of the text field based on the value of the check box.
Assuming you are using a single check box field named "ChecBox 1" and text field named "Text1" your mouse up action could be:
if(this.getField(event.target.name).value != "Off") {
// check box has been selected
this.getField("Text1").readonly = false;
} else {
// check box not selected
this.getField("Text1").readonly = true;
// option to clear the field if check box not selected
this.getField("Text1").value = "";
}
or
if(this.getField(event.target.name).isBoxChecked(0)) {
// check box has been selected
// make RW
this.getField("Text1").readonly = false;
} else {
// check box not selected
// option to clear the field if check box not selected
this.resetForm(["Text1"]);
// make read only
this.getField("Text1").readonly = true;
}
North America
Europe, Middle East and Africa
Asia Pacific