i believe you'll want to use a form _name_ attribute in combination with
a different _action_ attribute/resource for each form. in this way you
can be specific about which form is being submitted in a page with
multiple forms, and then each response resource may process its
web.input() unambiguously.

hope that helps.

/siznax


On Mon, Jan 24, 2011 at 5:35 AM, ilejn <[email protected]> wrote:
> Hello!
>
> What is the best way to put two forms at one Web page?
>
> Each form is just a textbox.
>
> While GET part is more or less clear (I just pass all these forms to
> template), processing POST I have to find out which form was filled
> since it is important for business logic.
>
> My current approach is to examine web.input() content
> if 'Url1:' in web.input():
>       checkurl = str(web.input()['Url1:'])
> else:
>       checkurl = str(web.input()['Url2:'])
>
> It works, though it does not look elegant. Could someone please
> suggest anything better.
>
> Besides this, I have to use different names for my two textboxes,
> while I prefer giving the same name to them. Is it possible [assuming
> 'id' and 'label' are different at HTML level] ?
>
> Thanks.
>
> Best regards,
> Ilja Golshtein.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web.py" 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/webpy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to