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
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.
Copy link to clipboard
Copied
Thanks for your help! And where should I place the JavaScript to make my radio buttons hidden then?
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.