Ich reiche ein Formular von jquery.ajaxForm ein. Aber durch Doppelklick auf die Maus wird das Formular zweimal gesendet, ich möchte verhindern, dass standardmäßig auf die Schaltfläche klicken, aber in $ .ajaxForm in welchem Ereignis kann ich Standard verhindern?In welcher Funktion kann Prevent Default für jquery.ajaxForm durchgeführt werden?
$('#counter-entry-form').ajaxForm({
beforeSubmit: function() {
$('#counter-entry-form').removeData("validator").removeData("unobtrusiveValidation");
$.validator.unobtrusive.parse($('#counter-entry-form'));
if ($("#counter-entry-form").valid()) {
$('#submitting-btn').attr('disabled','disabled');
} else {
return false;
}
},
success: function (result) {
if (result.Success) {
window.open('@Url.Content("~/Counter/PrintViewForSato?itemId=")' + result.ValueTwo, '_blank');
$('#IsFromNameSave').attr('checked', false);
$('#IsToNameSave').attr('checked', false);
$('#submitting-btn').removeAttr('disabled');
if ($('#IsBulkEntry:checked').is(':checked')) {
$('#BulkEntryCount').val(result.ReturnId);
$('#BulkEntryTotalAmount').val(result.ValueOne);
$('#ItemId').val('');
$('#ToName').val('');
$('#ToDestinationLocal').val('');
} else {
$('#ItemId').val('');
$('#Weight').val(0);
$('#FromName').val('');
$('#FromDestinationLocal').val('');
$('#ToDestinationLocal').val('');
$('#ToName').val('');
$('#Weight').change();
}
if ($('#IsReset:checked').is(':checked')) {
$('#BulkEntryTotalAmount').val(0);
$('#BulkEntryCount').val(0);
}
} else {
WorkForce.loader.hide();
ShowMessage("error", "error", result.Msg);
}
},
error: function (err) {
WorkForce.loader.hide();
if (err.statusText == 'Unauthorized') {
ShowMessage('error', 'error', 'Please Login to Continue !!');
} else {
ShowMessage('error', 'error', 'Error !!');
}
}
});
Ich habe bereits gleiche Sache in meinem Code enthalten, der –
ahh nicht funktioniert, dann ist das Button-Link oder Eingabe-Taste-Tag? –