I am brand new to Acrobat, and an extreme novice when it comes to Javascript.
I have created a quote request form for work, where people fill out what they need our company to quote, and then are able to return it by email. I have included a reset button at the bottom of the form, so that whoever fills it out can erase everything they have entered, and start from scratch.
I was able to add code, which I found online, to warn people before resetting the form. If they click yes, the form resets, if they click no, it will not reset. That code works! I've copied that below.
if( app.alert({
cMsg: "Do you want to reset this form?",
cTitle: "Reset Form Warning",
nIcon: 2,
nType: 2
}) == 4) {
this.resetForm();
}
So here is the problem I am having. When I first open the form, certain fields are set to be hidden. These fields become visible when I perform a certain action within the form. For example, I ask if the company is tax exempt. There is a yes and no radio button. If the person indicates yes, then a text field becomes visible where they can enter the number. If I click no, the field is hidden. This field should ONLY be visible when the yes radio button is selected. However, if I have yes selected, and then press the reset button, it will deselect the yes radio button, but will not re-hide the text field.
How would I get the reset button to reset the viewing state of the form to the default of when it was first opened? i.e. hidden fields revert back to being hidden, and visible back to being visible.
Hope it does :)