Denes,

> Strictly speaking only reset is valid HTML.
> But you can create any button you want.
> How? it depends on what do you want to do with it.
> In your case, what is "Cancel" going to do?.
>
> To add a reset button:
> form[0].append(TR(TD(),TD(INPUT(_type="reset",_value="Reset form")))
>
> form[0] is the table that defines the layout in the standard SQLFORM.


The code above added a button beneath the submit button, to add the
reset- and cancel button to the right of the submit button I used the
following code (it took me some time to figure this out, if there is a
neater way to code this, please let me know) :

submit_tr=form.element(_id='submit_record__row')
submit_tr[1].append(INPUT(_type='reset',_value='Reset'))
submit_tr[1].append(INPUT(_type='button',_value='Cancel'))

The reset button works. The cancel button should redirect the visitor
to the page he came from, this is not in every case the same page. I
guess I need to add an _onclick attribute ...?


Kind regards,

Annet.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to