Re: [web2py] buttons=['submit','reset','cancel'] and INPUT helpers

2012-10-22 Thread Annet
Hi Richard, Thanks for your reply and providing me with the link. This does exactly what I want: form.element('input[type=submit]',replace=lambda button: CAT(button, INPUT(_class="btn",_type="reset",_value="Reset"), INPUT(_class="btn",_type="button",_value="Cancel",_onclick="javascript:history

Re: [web2py] buttons=['submit','reset','cancel'] and INPUT helpers

2012-10-18 Thread Richard Vézina
Hello Annet, Don't know if it relevant, but Massimo add this recently : https://groups.google.com/d/msg/web2py/X5RCYHpckh0/Ut3ijuxiLqAJ from = SQLFORM(...) form.add_button("Cancel",URL(r=request,f='new_contact')) You can do that to : form.add_button(T('Cancel'), "javascript:void(history.go(-1))

[web2py] buttons=['submit','reset','cancel'] and INPUT helpers

2012-09-02 Thread Annet
The signatyre for the SQLFORM constructor has an attribute buttons = ['submit'] At the moment I add a cancel and/or reset button to my forms this way: form=SQLFORM.factory(..) addReserButton(form) addCancelButton(form) def addCancelButton(form): form[0][-1][1].append(INPUT(_type="