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

Hidden Radio buttons shall get hidden again after a form reset

Community Beginner ,
Sep 17, 2018 Sep 17, 2018

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

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.

Translate
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

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

Translate
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
LEGEND ,
Sep 18, 2018 Sep 18, 2018
LATEST

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.

Translate
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