Copy link to clipboard
Copied
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];
}
Copy link to clipboard
Copied
Instead of making it complicated for yourself,have you consider using layers to show/hide groups of fields?
Copy link to clipboard
Copied
No, I have not. I will do anything to make this less complicated! How do I use layers? Is it a javascript?
Copy link to clipboard
Copied
Try watching this video, you will see how it works and if it's right for you.
Copy link to clipboard
Copied
Nesa, I am on Adobe Acrobat Standard 2020 and I don't see where I can change or import layers. Is this not available on the Standard version?
Copy link to clipboard
Copied
On the left side of the screen right click and select layers:
Copy link to clipboard
Copied
I did that, and this is what I see:
Copy link to clipboard
Copied
Guess you probably need acrobat pro then.
Where did you stuck with rect scripts, can you share your file?
Copy link to clipboard
Copied
I think it might be a permissions issue that my IT needs to resolve. I am waiting on them enable the permissions. If that doesn't solve it, I will share my file with you. Thank you!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now