> -----Original Message----- > From: Priest, James (NIH/NIEHS) [C] > Sent: Wednesday, October 24, 2007 9:33 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] how to reset hidden radio fields??? > > > What I'd like to do is if the user clicks 'yes', then 'no' again - > hiding the optional questions - I'd like to clear any they might have > checked in the optional question. So if they click 'yes' again - they > are presented with a clean slate.
OK - I've re-written things: $("[EMAIL PROTECTED]'flexschedule']").click(function() { var mycheck = $("[EMAIL PROTECTED]'flexschedule']:checked").val(); if (mycheck == 'No') { $('##flexsched, ##flexother').hide('fast') $("[EMAIL PROTECTED]'scheduleID']").attr('checked', ''); $("[EMAIL PROTECTED]'FlexOTHER']").attr('value', ''); } else { $('##flexsched').show('fast'); }; }); And this seems to do what I want. Yeah for jQuery! If anyone has any suggestions on how to further improve the above - let me know :) Jim