Thread: Form adds
View Single Post
Old 11-27-2009, 03:19 AM   #2 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

1) Yes, make them one form, and they have one submit.

There is no protocol for POST1, POST2, etc. So everything you send, either via GET or POST is technically being sent as a single string of data. If you wanted to, you could nest an array inside of $_POST. Use names for your inputs such as;

html Code:
<input type="text" name="form_one[option_one]" value="" />
<input type="text" name="form_two[option_one]" value="" />

2) Yes, but again it's not technically the same form. You can post data from one form to the next and than pass it on the second time either via hidden inputs, session variables, ajax, etc.

There's a lot of possibilities for ways to handle this. Handle the forms as they come and just insert data fragments until you've got a complete row; place the data from the first table into a meta table that the second form will use to complete the row in the actual table; as mentioned above, pass the data along through hidden inputs and re-validate it on the other side of the second form; store it in session variables that the second forms handler will use to complete the query; etc.
delayedinsanity is offline  
Reply With Quote