I can't figure out why 'onClick' function trigged twice.
My html code:
<div class="form-actions right1">
<button type="button" id="btnCancel" class="btn default">
Cancel
</button>
<button type="submit" id="btnSubmit" class="btn blue">
Submit
</button>
</div>
Script is here:
$("#btnSubmit").on("click",function () {
debugger;
alert("Click");
CreateOfficeTypeManager.SaveOfficeType();
});
$("#btnSubmit").on("click",function (e) { e.preventDefault();which is better done on the form submit event$eventpassed into the callback, you can get more info of what is happening. Debugger is your friend ..