As NIphlod says there is a BUTTON helper. Yet instead of
<button id="b_normal" class="btn btn-danger"
onClick="ajax('{{=URL('test')}}',[],':eval')">Delete Role</button>
I would do:
{{=A('Delete Role', _id="b_normal", _class="btn btn-danger",
callback=URL('test'), target=':eval')}}
which will look the same. Why use BUTTON when you can use A with class
"btn" and works the same?
On Saturday, 15 December 2012 05:53:36 UTC-6, Daniele wrote:
>
> I tried putting this HTML
> <button id="b_normal" class="btn btn-danger"
> onClick="ajax('{{=URL('test')}}',[],':eval')">Delete Role</button>
>
> which I saw on a stackoverflow post. However, even when I do that and
> click the button, the form ALWAYS gets submitted. I already have a submit
> button so I don't understand why the form is being submitted via other
> buttons as well. Does anyone know why this is???
>
> 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
>>
>
--