Page 1 of 1
Nested FORM
Posted: Tue Oct 24, 2006 11:00 pm
by alex.barylski
I could write up some simple HTML and validate it, but...
Does anyone know if this is valid XHTML (transitional)?
Also, If the nested forms are submitted, do they only submit their contained data? Likewise, if the parent FORM is submitted, do all the sub-forms INPUT fields also get submitted?
Just curious...
Cheers

Posted: Tue Oct 24, 2006 11:19 pm
by Burrito
no, no, and no
Posted: Wed Oct 25, 2006 9:15 am
by SpecialK
You should never use nested forms.
The work around is either using JavaScript to redirect or multiple submit buttons on one form with server side based on the button clicked.
That way all the data can be submitted, but you only need to pull the data that you require and ignore the rest.
Posted: Thu Oct 26, 2006 11:11 am
by alex.barylski
I'll explain my situation a little more
I have a master FORM and dynamically generated FORM's each with an arbitrary number of FORM elements.
Code: Select all
Master FORM
===========
Name: |_______________|
Phone:|___| |___| |___|
Address: |__________________|
[Cancel] [Save]
Secondary dynamic FORM(s)
==================
Business Website: |_______________|
Personal Website: |_____________|
[Cancel] [Save]
The secondary FORM(s) may be unlimited...fields are arbitrary as are the number of FORM(s)
I wanted to have a single [Save All] button incase someone changed a field in each FORM, but if nested FORM's aren't allowed I can only think to use AJAX to iteratively save each seperate FORM (or at least those which have modified content)???
Know of a better way, perferably without using javascript?
Cheers

Posted: Thu Oct 26, 2006 1:17 pm
by feyd
Engineer the names such that you don't require multiple forms?