A few things…

1)

   - args takes a list
   - vars takes a dict
   
do you mean to use vars instead of args?

2) If deploy_name is a field in the form, and you want to get the value of 
it on clicking the button, you need to use javascript, like jQuery or the 
likes. 

3) Actually I am not sure what you want to achieve, so I can only guess, 
and I may be wrong. 

   - By default, web2py will submit the form to itself and return back the 
   original form. You can call other functions from within that function. 
   - In your quoted case (the button's code), clicking on the button only 
   takes the user to another page instead of submitting the form. 
   


On Monday, August 11, 2014 8:11:19 PM UTC+8, Stephen Weiss wrote:
>
>
> I'm in search of a way to have multiple submit buttons on a form that 
> would perform a different function depending on whichever button was 
> pressed.
>
> After pressing whichever button, the form should be submitted and after 
> performing the function, return the user back to the original form.
>
>
> I have a standard 'index' method that builds the form and adds another 
> button like:
>
>    form.add_button("Reset", URL("reset", args = dict(deploy_name = 
> request.vars.deploy_name)))
>
>
> When i press the Reset button, it calls the *reset* method I have 
> defined, but I have two problems:
>
> 1. I can't seem to get the value of the deploy_name, which is a field on 
> the form.
>    Is args the proper method of passing variable information or should I 
> be using something else?
>
> 2. I can't seem to redisplay the form as it originally started out as.
>     I tried adding a *redirect('index')* call to the end of the *reset* 
> method, but that causes strange operation.
>
> Thanks!
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to