I have a form where a button included, when button is clicked the form is submitted, and how to prevent this. for example I just want to show a "alert" when the button is clicked. and put the button outside of form is not a option for me.
and BTW I use bootstrap framework.
<form class="form-inline" role="form" id="form-area">
<input type="hidden" name="key" value="dept-area">
<div class="form-group">
<input type="text" class="form-control" name="data" placeholder="">
</div>
<button class="btn btn-default" id="btn-area">test</button>
</form>