I have the button 

<button onclick="{{=URL 
<http://127.0.0.1:8000/examples/global/vars/URL>(del_role)}}" class="btn 
btn-danger">Delete Role</button>


And in my controller I try to put def del_role and, if the user has 
membership, i want to del_membership for that role. But this doesn't seem 
to be working. You were telling me to use _href or callback but, I don't 
think I can use those with a button html tag...


On Tuesday, December 11, 2012 2:29:58 PM UTC, Massimo Di Pierro wrote:
>
> {{=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
>>>>
>>>

-- 



Reply via email to