Hidden Radio buttons shall get hidden again after a form reset

Community Beginner ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Hi everybody!

First of all thanks to you guys for your help!

This place this so helpful and friendly for everyone. awesome

Now to my todays problem I have to solve.

Ive made an reset button which resets just some fields with the following javascript for every field:

this.getField("***").value = this.getField("***").defaultValue;

Now I have the problem that I have a checkbox which shows hidden radio buttons by activation.

My problem is now that the Javascript above is also deleting the hiding property of the radio buttons.

So What can I do to hide my radio-buttons again, do anyone have an idea? Tanks in advance and sorry again for my bad English

TOPICS
Acrobat SDK and JavaScript

Views

118

Likes

translate

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
Adobe Community Professional ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

You can make a field hidden with JavaScript:

getField("radio1").display = display.hidden;

Also, there's an easier way to set fields to their default values, by using the resetForm method. For example:

resetForm(["text1", "radio2", "radio3", "checkbox5"]);

When a field is reset, its value is set to its default value.

Likes

translate

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 ,
Sep 17, 2018 Sep 17, 2018

Copy link to clipboard

Copied

Thanks for your help! And where should I place the JavaScript to make my radio buttons hidden then?

Likes

translate

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
Adobe Community Professional ,
Sep 18, 2018 Sep 18, 2018

Copy link to clipboard

Copied

That depends on when you want it to happen. If you want it to happen at the same time that the fields are reset with your current button, just add the code to set the hidden property after the other code you're currently using.

Likes

translate

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