checkbox group where one value shows a set of radio buttons

checkbox group where one value shows a set of radio buttons

Thank you to everyone that has helped me in the past.

In my form is a checkbox group, that when one value is checked, a set of required radio buttons appears.
The jquery show hide is working.

When this particular value is unchecked, the set of radio buttons becomes not required and if a radio button was clicked, the value is removed.
This is working great too

When the form is submitted, the person is taken to another page to review their form.  
While the value is still in the database, the jquery code I am using has removed the radio button value.  If a radio button has been clicked on the initial form, I need that clicked on this review page.  Unfortunately the jquery code I'm using removes the value.

Any help would be appreciated.  Below is my jquery code:

  1. $(document).ready(function() {
  2. $('#freeform_ch_ethnic_7').change(function() {
  3. var checked = $(this).is(':checked');
  4. $('#freeform_ch_ethnic_radio_1').toggleClass('required error', checked);
  5. $('#ethnicNew').toggle(checked);
  6. }).change();
  7. $('#freeform_ch_ethnic_7').click(function() {
  8. var checked = $(this).is('');
  9. $("#freeform_ch_ethnic_radio_1").removeAttr("checked");
  10. $("#freeform_ch_ethnic_radio_2").removeAttr("checked");
  11. $("#freeform_ch_ethnic_radio_3").removeAttr("checked");
  12. $("#freeform_ch_ethnic_radio_4").removeAttr("checked");
  13. $("#freeform_ch_ethnic_radio_5").removeAttr("checked");
  14. $("#freeform_ch_ethnic_radio_6").removeAttr("checked");
  15. }).change();
  16. });

What I am hoping for is that there is a way for jquery to determine on my review page, that if  freeform_ch_ethnic_7 is checked, the value ( freeform_ch_ethnic_radio_1 or whichever  radio value ) has been clicked, remains.

Thanks

Peter T