Alex Rivera | Logout

How to override (disable) the "submit" behaviour of a button tag inside of a form tag?

Asked 2011-02-24T05:23:43.313
24
<form action="">
  <button>click</button>
</form>

The default behaviour of a button inside a form is to submit that form.

How can I disable the submit behaviour of that button?

Edit
Report

1 Answer

5

This will disable via javascript

<button onclick='return false'>click</button>

But you can just define the type

<button type='button'>click</button>
answered 2011-02-24T05:25:15.930

Your Answer