if ($(document.forms[0]).valid() == false) {
alert(val.valid());
return;
}
Blogger Labels: jQuery
if ($(document.forms[0]).valid() == false) {
alert(val.valid());
return;
}
Blogger Labels: jQuery
$("input[type='submit']").each(function () {
$(this).attr("disabled", "disabled");
});
//Disable all the submit buttons when user click on any submit button
function DisableSubmitButtons( clickedButton) {
$("input[type='submit']").each(function () {
if (this.name != clickedButton)
$(this).attr("disabled", "disabled");
else {
//hiding the actually clicked button
$(this).hide();
//Creating dummy button to same like clicked button
$(this).after('<input type="button" disabled="disabled" value="' + $(this).val() + '" class="' + $(this).attr('class') + '" />');
}
});
}
This code disables all the submit buttons and hide the clicked button and put a new disabled button in it's place.
You can call this function with passing the clicked button Id
Example :Here is the example snipped code to call DisableSubmitButton function in Save button click
$('#btnSave').click(function(){
//I have hard coded to easily understand you can pass dynamically
DisableSubmitButtons("btnSave");
});