ASP.NET MVC Jquery Validation Returns True Always -


why when forms show validation has not passed, return value following code still returns true. forms indicating validated fields in error code below adds wait no matter because valid method returns true.

$(document).ready(function () {         $("input[type=submit]").click(function () {             if ($("input[type=submit]").valid() == true || $(this).attr("name") == "savedraft")                 {                   $("*").css("cursor", "wait");                  }         });     }); 

this basic unobtrusive validation built .net.

i had reference element directly instead of how doing it.

$("#mysubmitbutton").

instead of $("input[type=submit]").


Comments

Popular posts from this blog

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

java - Why is BlockingQueue.take() not releasing the thread? -

jQuery Ajax Render Fragments OR Whole Page -