Is there a way to find a form object without using its name?
The problem is the form is being processed using a third party site (CreateSurvey.com). In order for it to work there the check boxes for a question all have to have the same name. (They have different IDs in the HTML, but I don't see a way to assign an ID in Acrobat.)
In order to get my code to work (which deselects A, B, or C if the user clicks D, and vice versa) I had to rename the check boxes so they had different names. This will break the form at CreateSurvey. However, if all four check boxes have the same name there's no way for me to access them using JavaScript in Acrobat.
What I'm hoping is that there's some other way to identify a check box other than this.getField("fieldname") that will work.
Here's my code. Suggestions welcome.
function clickedBox3ABorC()
{
var d_box;
d_box = this.getField("c.37_4");
if (d_box.value == "4") {
d_box.value = "Off";
}
}
function clickedBox3D()
{
var a_box;
var b_box;
var c_box;
var d_box;
a_box = this.getField("c.37_1");
b_box = this.getField("c.37_2");
c_box = this.getField("c.37_3");
d_box = this.getField("c.37_4");
//console.println(a_box.value);
//console.println(event.target.value);
if (d_box.value == "4") {
a_box.value = "Off";
b_box.value = "Off";
c_box.value = "Off";
}
}
Thanks!
->Later.....Spice
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com