Hi Pat,
As with any other web framework, you have a couple of options: You can make
the URLs for the forms different - for example by including a query string
argument in one, and checking it with self.request.GET[...] - or you can
include a form field that allows you to tell the two forms apart.

-Nick Johnson

On Mon, Sep 21, 2009 at 1:30 AM, PatHaugen <[email protected]> wrote:

>
> Experimenting with GAE, I had a simple question I couldn't find the
> answer to in the doc pages, googling 'multiple forms' or same query on
> this group...
>
> My question is with multiple forms on one page, let's say 'MainPage'
>
> class MainPage(webapp.RequestHandler):
>  def get(self):
>    # Display a form
>    # Display a second form
>  def post(self):
>    # Handle form data
>
> Using this method both forms go to execute the same code.
>
> I'm wondering if there is a way to do something like:
> def post(myvariable):
>
> Then somehow link each form to a separate 'def post()' are?
>
> In PHP for example I'd code in via the submit button:
> <input type="submit" name="adduser-submit" value="Create User" />
>
> Then have a code block:
> if (isset($_POST['adduser-submit'])) {}
>
> What is the way for having multiple forms in GAE?
>
> As a side note, are there other options for 'def get(self)' and 'def
> post(self)'? I currently don't touch them because I haven't found
> documentation or examples of otherwise..
> >
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
368047

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to