Highlighted

Hiding Check Box

New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

I am not a javascript person and not sure this question is related to javascript.

I have a form with a row of Text Boxes.  The first box is a Check Box and when selected, the Text Boxes in the row will display (hidden if the check box is not checked).   At the end of the row, I added another Check Box that I want hidden unless the first checkbox in the row is selected.  Since there is no Calculate Section for a calculation, is there a way to accomplish this?

If I got it right , you want, if first checkbox is checked second checkbox is visible else if first checkbox
is not checked second checkbox is hidden?
You can do it like this:
If first checkbox is unchecked set second checkbox to hidden manualy(only first time, or after you input code just check and uncheck first checkbox
to sync them) use this code as MouseUp event on first checkbox (change name of the checkbox if needed):
this.getField("CheckBox2").display = event.target.value != "Off" ? display.visible : display.hidden;

TOPICS
Acrobat SDK and JavaScript

Views

41

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

Hiding Check Box

New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

I am not a javascript person and not sure this question is related to javascript.

I have a form with a row of Text Boxes.  The first box is a Check Box and when selected, the Text Boxes in the row will display (hidden if the check box is not checked).   At the end of the row, I added another Check Box that I want hidden unless the first checkbox in the row is selected.  Since there is no Calculate Section for a calculation, is there a way to accomplish this?

If I got it right , you want, if first checkbox is checked second checkbox is visible else if first checkbox
is not checked second checkbox is hidden?
You can do it like this:
If first checkbox is unchecked set second checkbox to hidden manualy(only first time, or after you input code just check and uncheck first checkbox
to sync them) use this code as MouseUp event on first checkbox (change name of the checkbox if needed):
this.getField("CheckBox2").display = event.target.value != "Off" ? display.visible : display.hidden;

TOPICS
Acrobat SDK and JavaScript

Views

42

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
Sep 08, 2020 0
Adobe Community Professional ,
Sep 08, 2020

Copy link to clipboard

Copied

Hi,

Can you confirm the version of the software and operating system you are using?

I think in Acrobat, this can only be done in Javascript, look at https://community.adobe.com/t5/acrobat/editing-show-hide-field-list-via-javascript/td-p/3819705?page...

I use Adobe (forms) Designer, it is much more powerfull than Acrobat for this type of development.

Let us know how you progress

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
Reply
Loading...
Sep 08, 2020 0
New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

I am running Windows 10 2004 and Acrobat Pro DC 2020.012.20043.

 

I have the Creative Cloud Suite but do not see that program.

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
Reply
Loading...
Sep 08, 2020 0
Engaged ,
Sep 08, 2020

Copy link to clipboard

Copied

If I got it right , you want, if first checkbox is checked second checkbox is visible else if first checkbox
is not checked second checkbox is hidden?
You can do it like this:
If first checkbox is unchecked set second checkbox to hidden manualy(only first time, or after you input code just check and uncheck first checkbox
to sync them) use this code as MouseUp event on first checkbox (change name of the checkbox if needed):
this.getField("CheckBox2").display = event.target.value != "Off" ? display.visible : display.hidden;

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
Reply
Loading...
Sep 08, 2020 0
bfry2461 LATEST
New Here ,
Sep 08, 2020

Copy link to clipboard

Copied

Thank you very much.

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
Reply
Loading...
Sep 08, 2020 0