{{=A('click me',_href=URL('action'))}} (redirects)
or
{{=A('click me', callback=URL('action'))}} (call via ajax)
or
<div id="t"></div> {{=A('click me', callback=URL('action'),target="t")}}
(call via ajax and store result in t)
or
<div id="c">{{=A('click me', callback=URL('action'),delete="div#c")}}</div>
(call via ajax and delete button)
They can be combined.
On Tuesday, 11 December 2012 04:41:25 UTC-6, Daniele wrote:
>
> Ok. What's the correct way of associating an action to the HTML button
> with web2py?
>
> On Tuesday, December 11, 2012 12:30:34 AM UTC, Massimo Di Pierro wrote:
>>
>> This is not worth it. If you make a custom form than you are using html,
>> you may as well make the button in html.
>>
>> On Monday, 10 December 2012 15:15:30 UTC-6, Daniele wrote:
>>>
>>> When I use form.add_button() I am able to add a button to a form, which
>>> I can display with {{=form}} in my view.
>>>
>>> However, if I'm making a custom form using form.custom, how can I
>>> display that button??
>>>
>>> Thanks
>>>
>>
--