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
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))
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="
3 matches
Mail list logo