Prevent button disabling when inputs are not valid jQuery Validation -


I used to disable the asp.net web form button when the button is clicked Click

  $ (function () {var button = set; setimimate (function () {$ (button) .attr ('disabled', 'disabled');}, 100);});} );   

But when I & amp; Amp; From plugin to page,

  $ (document) .ready (function () {$ ("# form1"). ValidifyWebForm ({Rule: {myDate: {customDate: true}, nic: { NicNo: true}}} ... ...   

Disables the button even if this input is not valid. Input is not valid, how to avoid disabling the button?

Disable the button and test the form before submitting According to the comment, I know that you are starting a valid jQuery plugin with another plugin, but the basic concept should be below

Demo:

jQuery :

  $ (document). (Function () {$ ('# myform') validate ({// rules and options }; $ ('Click', function (e) {e.preventDefault}; if ($ ('$ myform') Valid ()) {$ ('# myform'). Do (); $ (This) .attr ('disabled', 'disabled');}}); });   

HTML : & lt; Form id = "myform" & gt; .... & lt; Input id = "button" type = "submit" / & gt; & Lt; / Form & gt;


Alternatively, if your other plugin allows you to use the submitHandler callback function, then I recommend using it instead I do

It only sets a valid form on fire and it actually clears this unnecessary and unnecessary event handling. $ {Document} .ready (function () {$ ('# myform') Valid webform ({// your rule, submit handler: function (form) {$ ('# Button '). Aitry (' disabled ',' disabled ');}}};});

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -