views:

26

answers:

1

Say if I have multiple forms with multiple submit button in a single page, can I somehow make all of these buttons work using webapp as backend handler? If not, what are the alternatives?

+4  A: 

The framework you use is irrelevant to how you handle forms. You have a couple of options: you can distinguish the forms by changing the URL they submit to - in which case, you can use the same handler or a different handler for each form - or you can distinguish them based on the contents of the form. The easiest way to do the latter is to give your submit buttons distinct names or values, and check for them in the POST data.

Nick Johnson
It seem that if you're using google app engine's webapp, you can't get anything from your submit button, but I could be wrong.
Khoi
There's really nothing unique about webapp or App Engine here - forms are submitted the same way regardless of what receives them. If you give your submit button a name and a value, it'll be included in the POST data.
Nick Johnson