Copy link to clipboard
Copied
Hello,
I do not have much knowledge of javascript, and i am trying to put a form together for people to fill out. in one section i have a checkbox that is a "No To All Below" and the i have about 7 seperate groups of radio bottons each with a "Yes" and "No". i am hoping it is possible, and if so: where i would need to put something that would make all the radio buttons automatically say "No" when checkbox is checked. thank you for any help.
As the Mouse Up event of that check-box field enter the following code (let's assume the export value of that box is "NoAll" and that the radio-button groups are named "Radio1" to "Radio7" with export values of Yes and No):
if (event.target.value=="NoAll") {
for (var i=1; i<=7; i++) this.getField("Radio"+i).value = "No";
}
Copy link to clipboard
Copied
As the Mouse Up event of that check-box field enter the following code (let's assume the export value of that box is "NoAll" and that the radio-button groups are named "Radio1" to "Radio7" with export values of Yes and No):
if (event.target.value=="NoAll") {
for (var i=1; i<=7; i++) this.getField("Radio"+i).value = "No";
}
Copy link to clipboard
Copied
Hello, thank you very much for responding, but for some reason i can not get it to work. i have changed the names of the radio groups to be TBQues1 to TBQues7 and then made sure the checkbox value is what you have, but i'm not getting anything to populate a change when i click the checkbox. i did not get any errors when saving either
Copy link to clipboard
Copied
Check the JS Console (Ctrl+J) for errors after clicking the check-box.
If you still can't solve it, please share the file for further help.
Copy link to clipboard
Copied
I got it to work, thank you so much, i had a space in the first radio button group name, so it was erroring out there, and i didn't see it until you mentioned to console. thank you again
Copy link to clipboard
Copied
Did you change "Radio" to "TBQues" in script?
If you are not sure if checkbox value is "NoAll" you can use like this: if (event.target.value !== "Off") {