hide fields with checkbox’s
Copy link to clipboard
Copied
I have radio buttons check box's Choice1 and Choice2
When the user checks Choice 1 I need for field Destination to hide
When user checks Choice 2 I need for PORT and FOREIGN to hide
I also need to use the reset button to return them to original document.
Copy link to clipboard
Copied
Are they radio-buttons of check-boxes? Do they have the same name but unique export values, or do they have unique names? If the latter, what's their export values, and what should happen if both are ticked?
Copy link to clipboard
Copied
The radio buttons are Choice1 and Choice 2 =both Group1.
Copy link to clipboard
Copied
one or the other has to be selected. They both cannot be selected at the same time.
Copy link to clipboard
Copied
OK. And are the other fields text fields?
Copy link to clipboard
Copied
Yes text then a fillin field.
Copy link to clipboard
Copied
OK, then as the custom calculation script of the first field use this:
event.target.display = (this.getField("Group1").valueAsString=="Choice1") ? display.visible : display.hidden;
And under the other two fields use this:
event.target.display = (this.getField("Group1").valueAsString=="Choice2") ? display.hidden : display.visible;
Copy link to clipboard
Copied
Ok so I gave this a try and it seems to be permanently hiding the destination field.
also I want the entire field to disappear like the word destination and the fill-in text box to disappear. Is that possible?
Copy link to clipboard
Copied
Please share your file for further help.
If you want to hide the text next to the field you will need to place a (read-only) field on top of it, with a white fill color, and show it when you want the text to be hidden, and vice versa.
Copy link to clipboard
Copied
See attached
Copy link to clipboard
Copied
You should read this article:
https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
I am going to take a look at this.

