Copy link to clipboard
Copied
Hi,
I have 4 checkbox, if i select check box 2, the checkbox 1A and checkbox 1B is automatically unselect or may be not editable and if i unselect the check box 2, the checkbox 1A and checkbox 1B should be available for editing. Could anyone pls provide script for this.
Copy link to clipboard
Copied
var CheckBoxVal = this.getField("CheckBox 2").value;
var otherfield= "if (event.target.value != "Off") {
this.getField(" this.getField("CheckBox 1A").readonly = true;
this.getField(" this.getField("CheckBox 1A").readonly = true;
} else {
this.getField(" this.getField("CheckBox 1A").readonly = false;
this.getField(" this.getField("CheckBox 1B").readonly = false;
}"
CheckBoxVal.setAction("MouseDown", otherfield);
CheckBoxVal.setAction("MouseUp", otherfield);
Will this script work?
Copy link to clipboard
Copied
Use this script as Mouse UP event of "Check Box 2"
if (event.target.value != "Off"){
this.getField("CheckBox 1A").value = "Off";
this.getField("CheckBox 1A").readonly = true;
this.getField("CheckBox 1B").value = "Off";
this.getField("CheckBox 1B").readonly = true;}
else if(event.target.value == "Off"){
this.getField("CheckBox 1A").readonly = false;
this.getField("CheckBox 1B").readonly = false;}
Copy link to clipboard
Copied
var CheckBoxVal = this.getField("CheckBox 2");
Getting error for above line as CheckBoxVal is null.
Copy link to clipboard
Copied
You already got an answer for your original post, is it not working or you require something else?
What code are you trying to use and where?
Copy link to clipboard
Copied
var CheckBoxVal = this.getField("CheckBox 2");
var otherfield= "if (event.target.value != "Off") {
this.getField(" this.getField("CheckBox 1A").readonly = true;
this.getField(" this.getField("CheckBox 1A").readonly = true;
} else {
this.getField(" this.getField("CheckBox 1A").readonly = false;
this.getField(" this.getField("CheckBox 1B").readonly = false;
}"
CheckBoxVal.setAction("MouseUp", otherfield);
i am passing the above code via xml, in this code i'm getting error as CheckBoxVal is null. i dont know why it is null.