• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

hide fields with checkbox’s

Community Beginner ,
Dec 05, 2021 Dec 05, 2021

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. 

TOPICS
Acrobat SDK and JavaScript , Windows

Views

159

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2021 Dec 06, 2021

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?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

The radio buttons are Choice1 and Choice 2 =both Group1.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

one or the other has to be selected. They both cannot be selected at the same time. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

OK. And are the other fields text fields?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 06, 2021 Dec 06, 2021

Copy link to clipboard

Copied

Yes text then a fillin field. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2021 Dec 06, 2021

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;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 14, 2021 Dec 14, 2021

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? 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2021 Dec 15, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

See attached

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

You should read this article:

https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm?sd=40

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 20, 2021 Dec 20, 2021

Copy link to clipboard

Copied

LATEST

I am going to take a look at this. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines