Curious. I originally tested my method on IE7 and it works OK.
Nevertheless, Iceberg is right in that the button tag isn't consistent
across browsers. w3cschools.com says
"""
Always specify the type attribute for the button. The default type for
Internet Explorer is "button", while in other browsers (and in the W3C
specification) it is "submit".
"""


On Sep 20, 12:48 am, Iceberg <iceb...@21cn.com> wrote:
> On Sep20, 11:57am, weheh <richard_gor...@verizon.net> wrote:
>
> > OK, here's a way to do it:
>
> > {{=form.custom.begin}}
> > <button style="border: 1px solid blue;" type="submit"
> > name="process">Process</button>
> > <input value="default" type="hidden" name="myform" />
> > {{=form.custom.submit}}
> > {{=form.custom.end}}
>
> > Then, when you press the process button, the request.vars.process will
> > not be None.
>
> Interesting. But is this trick universally reliable, or just depends
> on different browsers?
>
> Searching on the web and I confirmed my suspicion. This old post
> mentioned "IE not sending the name/value pair for the submit button
> when Enter was pressed after filling in a field in the form." And my
> test confirmed that it is still the case even in today's IE7, which is
> still the majority of browser in the market, 
> huh?http://muffinresearch.co.uk/archives/2005/12/08/fun-with-multiple-sub...
>
> So I think we should not rely on this trick. If you really need
> multiple submit buttons, try some javascript technique mentioned in
> following post, although that way we need multiple actions in our
> controller, which is not DRY enough.  
> :-/http://www.phpbuilder.com/board/showthread.php?t=10248489
>
> Anybody who knows a better solution, please correct me. Thanks in
> advance!
>
> Regards,
> Iceberg
>
> PS: the test controller, if you like to test it by yourself.
> def test():
>   form=FORM(
>     INPUT(_type='text',_name='foo'),
>     INPUT(_type='submit',_name='s1',_value='111'),
>     INPUT(_type='submit',_name='s2'),
>     )
>   if form.accepts(request.vars):
>     response.flash=str(request.vars)
>   return {'':form}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to