wow, that's a lot of bubbling events...
you keep returning false and binding and unbiding the event... that will not work, but you can simple change your submit
button to a normal button
, for example:
<form name="input" action="html_form_action.asp" method="get">
Username: <input type="text" name="user" />
<input type="button" value="Submit" class="btn-submit" />
</form>
and write
$(".btn-submit").click(function() {
$(this).prop("disabled", true); // dont allow more clicks
alert('about to submit...');
$(this).closest("form").submit();
alert('done!');
});
DEMO in JsBin: http://jsbin.com/elokov/1/
with an ajax call to submit the form
$(".btn-submit").click(function(evt) {
$(this).prop("disabled", true); // dont allow more clicks
alert('about to submit...');
var frm = $(this).closest("form"); // our form
$.ajax(
type: frm.attr("method"),
url: frm.attr("action"),
data: frm.serialize(),
success: function(data) {
alert('all went well');
},
success: function(jqXHR, textStatus) {
alert('err, something messed up! ' + textStatus);
}
);
return false; // or use evt.preventDefault();
});