Copy link to clipboard
Copied
I’ve created a form and below is a snag-it of part of the form in question.
The drop-down “Expenditure Type:” has an option “Other” as one of the selections. When “Other” is selected the following appears:
Underneath the second row I have labels. I’m wondering if there is a way to hide/show the “Acct Code” and “Expenditure Type” (squared in red) when
Hide "Acct Code" and Expenditure Type" when the option "Other" is not selected
Show "Acct Code" and Expenditure Type" when the option "Other" is selected
Thank you for your assistance in advance.
Copy link to clipboard
Copied
As the custom calculation script of the drop-down enter this code:
if (event.value=="Other") {
this.getField("Acct Code").display = display.visible;
this.getField("Expenditure Type").display = display.visible;
} else {
this.getField("Acct Code").display = display.hidden;
this.getField("Expenditure Type").display = display.hidden;
}
Copy link to clipboard
Copied
As the custom calculation script of the drop-down enter this code:
if (event.value=="Other") {
this.getField("Acct Code").display = display.visible;
this.getField("Expenditure Type").display = display.visible;
} else {
this.getField("Acct Code").display = display.hidden;
this.getField("Expenditure Type").display = display.hidden;
}
Copy link to clipboard
Copied
I’ve tried the coding provided in the correct location and it does not seem to be working. The “Acct Code” and “Expenditure Type” are “Add Text” boxes created in Edit PDF Tool, and not a "Text Field" created in Prepare Form Tool. I apologize if I confused the terms.
Please let me know if there is a way to show/hide these fields, if not, is there another solution?
Thanks again for your assistance.
Copy link to clipboard
Copied
You should use text fields for this.
Copy link to clipboard
Copied
Great suggestion. I used text fields and got it to work - partially.
How do I auto-populate the text fields with the labels needed "Acct Code" and "Expenditure Type"?
Copy link to clipboard
Copied
You can enter those values as their default values.
Copy link to clipboard
Copied
Blushing..........I should have known that
Thank you so much.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now