Pull document level javascript
I have a working JavaScript (below) but, because it will ultimately affect 9 fields, it will get very long. The changes in a text field are triggered by whether a check box is checked or not so currently the JavaScript is in the Mouse Up Action of the check box. I assume a Doc Level is more efficient? I have other Doc Level scripts which are contained within 1 field but since this is triggered by the check box I expect I need a different method. I have a Reset Button on the form which would also need the ability to reset those specific fields.
Working JavaScript in Mouse Up Action of check box:
var r = getField("cb7");
var s = getField("III.A.3");
if (r.type === "checkbox" && r.value == "additional victims on page 2") {
s.readonly = false;
s.required = true;
s.fillColor=["G",.8];
s.value = "";
}
else
if (r.type === "checkbox" && r.value != "additional victims on page 2"){
s.readonly = true;
s.required = false;
s.fillColor=color.transparent;
s.value = "";
}
Thanks
Meabh
