Skip to main content
Participating Frequently
September 18, 2018
Question

Hidden Radio buttons shall get hidden again after a form reset

  • September 18, 2018
  • 1 reply
  • 544 views

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

This topic has been closed for replies.

1 reply

Inspiring
September 18, 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.

Participating Frequently
September 18, 2018

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

Inspiring
September 18, 2018

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.