Thank you for your comments Leonel.
I agree with the triggering and the more general URI encoding.
Not sure what you mean by using a hidden field, all the buttons belong to
the same form, they just have different names and values.
The code has been updated as follows (relative to the original post):
var srlbtn;
form.on('click', 'input[type="submit"], button[type="submit"]',
function (e){
/* serialize button used to submit form */
var btn = e.target;
srlbtn = '&' + encodeURIComponent(btn.name ? btn.name : btn.type)
+ '=' + encodeURIComponent(btn.value);
});
Denes.
On Friday, November 7, 2014 2:23:02 PM UTC-5, Leonel Câmara wrote:
>
> You can just use a hidden field, like formname, or event better you can
> have different actions for the forms. As for the code, I don't like that
> this is triggered for all clicks in the form, maybe form.on('click',
> '[type="submit"]', .... You also need to encodeURI the submit button's
> name and value.
>
> Frankly, I don't like this much. I think this should be accomplished with
> the form's action.
>
>
>
--
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.