I want to do something very simple but it's taking me eons to do this~

When the button is clicked, I want a javascript alert to pop up that asks, 
are you sure? Yes/No.
If Yes, then run this code: auth.del_membership('role')

No redirection, just delete the role.
That's all -_- this is taking me way too long....

On Saturday, December 15, 2012 3:32:22 PM UTC, Massimo Di Pierro wrote:
>
> None. You are asking to ":eval" the result. It meas the action is supposed 
> to return JS
>
> def test():
>     return "alert('hello')"
>
> anyway, you should debug this with the JS console in chrome. We do not 
> know exactly how your code looks like.
>
> On Saturday, 15 December 2012 09:08:37 UTC-6, Daniele wrote:
>>
>> I am trying with:
>> {{=A('Delete Role', _class="btn btn-danger", _id="del_role_tutor", 
>> callback=URL('test'), target=":eval")}}
>>
>> and in my controller:
>>
>> def test():
>>     return "Hello"
>>
>> or 
>>
>> def test():
>>     return dict()
>>
>> but when I click the button, nothing happens. Why is this??
>>
>> On Monday, December 10, 2012 9:15:30 PM UTC, 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