In the markup, have the fieldsets use class="RequestDetail" id="InfoTYPE"
where TYPE is Software, Hardware, etc. and all initially display:none. The
radio group is name="RequestType" value="TYPE". Untested code, but here's
the idea:

$("#myform [EMAIL PROTECTED]").bind("click", function(){
   $("#myform .RequestDetail:visible).hide();
   $("#Info"+this.value).show();
});

Complicate as needed. :-)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Calamity
Sent: Thursday, December 14, 2006 10:39 AM
To: [email protected]
Subject: [jQuery] Toggling div based on radio buttons

hi, been playing with jQuery for all of about 3 days, and I need some
assistance on something simple.

Basically I have a form with several fieldsets (I can wrap them in divs if
absolutely necessary) that need to be displayed/hidden based on radio button
selection. For example:

There are 4 radio buttons: Software, Hardware, Telecom and Field Device

If a user clicks Software, it should display the fieldset that contains
pertinent information for software. If a user misclicked, or has an
additional request for say, hardware, I would like any section that is shown
to be hidden prior to showing the hardware section.

I am, unfortunately, struggling with this, any ideas out there?


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to