Submit multiple forms as one
Posted
by
Stephen Sarcsam Kamenar
on Stack Overflow
See other posts from Stack Overflow
or by Stephen Sarcsam Kamenar
Published on 2012-11-16T22:55:56Z
Indexed on
2012/11/16
22:59 UTC
Read the original article
Hit count: 148
I have two forms on the page. To the user it looks like 1 form, and I actually wish it was one form. But the way I'm trying to reuse code and include things, I can't avoid two forms in the source code... trying to act as one.
I don't want to do ajax submit, I want a normal post submit, my form handler has redirects in it. How can I submit both of these, and get values that make sense on the server side. something like $_POST['form1]['whatever']
$_POST['form2]['thing']
Maybe take all the inputs from form 2, rename all of them with a prefix, and append them to form 1? I can't find a non-messy way of doing this. I don't think I need code, just a plan. Least messy idea wins.
© Stack Overflow or respective owner