I have a Form with a number of Yes/No radiobuttons. If any of the radiobuttons is "Yes" then I need to set another Radiobutton field to "Yes," else "No.
I borrowed heavily from https://answers.laserfiche.com/questions/75180/Can-you-create-a-test-that-will-auto-score-in-Forms
So, I have each of the radio buttons in CSS class radiobutton. I have the radiobutton for the result with class pf. For each of the radiobuttons, I have a value of 1 for the "Yes" answer. I have this code in the form:
$(document).ready(function (){ $('.radiobutton').change(function (){ var sum = 0 $('.radiobutton input:checked').each(function)(){ sum += Number($(this).val().replace(/V_/g,'')); }); if (sum >=1) { $('.pf input').val("Yes"); } else $('.pf input').val("No"); } }); })
I believe I have all the parts together. And Yet, nothing works.
Is there some js genius out there somewhere who can assist?