Ideally something like this will work for you...

def test_form():
     form = SQLFORM(db.table,
        buttons = [INPUT(_type='Submit', _name='submit1', _value='Submit1'),
                       INPUT(_type='Submit', _name='submit2', 
_value='Submit2')])
    if form.accepts(request):
        if form.vars.submit1:
            pass
        elif form.vars.submit2:
            pass
    return form 

Works in IE10, but this may not work in older browsers (such as IE7) so you 
might need to resort to a javascript solution as discussed here:

https://groups.google.com/forum/#!msg/web2py/D0S2-VsFjfU/YGsKiUf4wXkJ





On Monday, April 22, 2013 6:57:18 AM UTC+12, lucas wrote:
>
> hello one and all,
>
> working on a custom SQLFORM.  i use the form.custom.submit to display it 
> in the view and when it is pressed it properly updates that record in the 
> databse. good.  now i want to add a second custom button that will also 
> still update the fields to the proper record and then do a redirect to 
> another function in the controller.  i've read a few close posts and tried 
> them, but all unsuccessful.  how can i add a second custom button and a 
> method in the function to know when that other button was pushed, still 
> updating the record and then redirecting.
>
> thanx in advance.  lucas
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to