Is it possible to submit multiple forms with one submit button?

136 views
Skip to first unread message

Lamps902

unread,
Nov 3, 2012, 10:44:06 AM11/3/12
to web...@googlegroups.com
I have a grid in which I'd like to put a form between each column header/label. Is it possible to submit and pass the data from all of these forms with a single submit button? Tried a couple of jquery solutions, but it wasn't quite working out.

Alternatively, is it possible to make a single form and split its input fields among the column headers?

Thanks.

howesc

unread,
Nov 4, 2012, 11:41:58 AM11/4/12
to web...@googlegroups.com
i suspect there are a couple of options here, though i encourage you to think carefully before implementing them (i assume that there is good reason why forms still work the way they do).

 - you can create a button with an onclick action that will collect data from various input fields and post it to the server in one or more AJAX calls
 - sure you can create one large form, but you'll need to carefully name all the input fields so that you know what is what.

Lamps902

unread,
Nov 4, 2012, 11:09:46 PM11/4/12
to web...@googlegroups.com
Thanks. Took care of it by having a form with a submit button and a bunch of hidden fields, and a bunch of forms with a single input field, in the headers. When the "submit' button is pressed on the form with the hidden fields, the values from the other forms are copied to its corresponding fields, and all of the necessary vars are passed via "get." So that's basically how I went about implementing a multi filter with input fields under the headers for web2py's grid, though I'm sure there's a better way...

-Lamps
Reply all
Reply to author
Forward
0 new messages