I used this code (from SO) to disable asp.net Web Form button to disable button when clicked
$(document).ready(function () {
$('[id$=btnSave]').click(function () {
var button = this;
setTimeout(function () {
$(button).attr('disabled', 'disabled');
}, 100);
});
});
but when I add jQuery validation & JQuery Validation Groups for WebForms plugins to page,
$(document).ready(function () {
$("#form1").validateWebForm({
rules: {
myDate: {
customDate: true
},
nic: {
nicNo: true
}
}
});
...
<asp:TextBox ID="txtName" runat="server" CssClass="required" ></asp:TextBox>
It disables the button even when the inputs are not valid. How to avoid disabling the button if the inputs are not valid?
validateWebForm(). The initialization function is just called.validate().readyfunction...