On Monday, October 1, 2012 2:25:58 PM UTC-7, David Sorrentino wrote:
>
> No problem! :)
>
> So, is there any method to customize the elements of a form (fields and 
> buttons) without using a custom form?
> Because I managed to customize it with form.custom... but then I can't add 
> a cancel button.
>
> Thanks a lot! :)
> David
>
 

I use form.custom as well. Based on this thread, I included the following 
in the add() function of my controller:

cancel_button = INPUT(_type='button', _value='Cancel', 
_onclick='window.location=\'%s\';;return false' % URL('index'))

It has the same resulting code as form.add_button('Cancel', URL('index')).

I changed the URL() function to URL('view', args=[id]) for my edit() 
function. Then I just add {{=cancel_button}} next to 
{{=form.custom.submit}}.

Carlos Hanson

-- 

--- 
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/groups/opt_out.


Reply via email to