Thanks for that useful information, Anthony. I ended up creating a hidden variable in the form and setting the value of the variable when the button is clicked, i.e., FORM( INPUT(_type='submit', _value='button1', _onclick='document.form1.hiddenvar='button1';), INPUT(_type='submit', _value='button2', _onclick='document.form1.hiddenvar='button2';), _name='form1', hidden=dict(hiddenvar='') )
That works OK, but I'm not sure how you could generalize it for any web2py.js form submission :). On Monday, July 1, 2013 9:58:56 AM UTC-5, Anthony wrote: > > Ajax form submissions use the jQuery .serialize() method, triggered by the > form submit event. The .serialize() method doesn't know how the form was > submitted, so it does not have information about any button clicks (and > therefore the name of the button that was clicked). You can search online > for some workarounds to this problem. If you come up with something > generalizable, maybe we can add it to web2py.js. > > Anthony > > On Monday, July 1, 2013 10:27:58 AM UTC-4, Jim Gregory wrote: >> >> Yes, the form is a component. > > -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.