Grouping Text Fields & Check Boxes under Specific Category in PDF Form
In my form, an individual will select a checkbox with the category, once selected it will open up the category section with additional information needed in text fields and checkboxes. I have found how to hide and display the fields dependent on the category box being checked or not. I am just having a really hard time with getting the category information fields/boxes to move up or down the document depending on the other category boxes checked - and keeping the same properties. I tried the rect javascripting, but something is not working right.
I was thinking I could group all the fields together under the Category Section name, then overwrite the hidden category sections/information fields when they are not visible. Is this possible?
If needed, here is what I was currently using for my javascript on the MouseUP action:
var a = this.getField("Category2 checkbox");
var b = this.getField("Category1 Label").rect;
var c = this.getField("Category1 Text Field1").rect;
if (a.is Box Checked(0)) {
this.getField("Category2 Label").display = display.visible
this.getField("Category2 Text Field1").display = display.visible
}
else {
this.getField("Category2 Label").display = display.hidden
this.getField("Category2 Text Field1").display = display.hidden
}
var d = this.getField("Category1 checkbox");
if (((d.is BoxChecked(0)) && (a.isBoxChecked(0))) || (d.isBoxChecked(0))) {
this.getField("Category2 Label").rect = [72,215,303,237];
this.getField("Category2 Text Field1").rect = [71,191,201,213];
}
else if (a.isBoxChecked(0)) {
this.getField("Category2 Label").rect = [b[0], b[3]+22, b[0]+231, b[3]];
this.getField("Category2 Text Field1").rect = [c[0], c[3]+22, c[0]+130, c[3]];
}
else if (event.target.value == "Off") {
this.getField("Category2 Label").rect = [72,215,303,237];
this.getField("Category2 Text Field1").rect = [71,191,201,213];
}