views:

653

answers:

2

I have a form and up the top it contains four different radio buttons - the rest of the form changes depending on which of these radio buttons are selected. Currently each 'part' of the form is in its own fieldset and I'm hiding/showing these with Jquery.

How can I only submit the data that is relevant to which part of the form is filled out? I don't want to submit three empty areas on the form and only one filled in part.

Thanks.

+1  A: 

Just create three different forms, separate your fields between them and then submit the right one. They can all point to the same URL...

nivhab
+1  A: 

you could $("#fieldset1").remove() the fieldsets on form submit. not as elegant as nivhab proposed but it's an alternative too

miceuz