Sunday, 15 March 2015

jquery - Checking HTML 5 validation is successful or not -



jquery - Checking HTML 5 validation is successful or not -

i need check whether html 5 native validation successful or not. based on need phone call ajax function.

an illustration code here. http://jsfiddle.net/indiscover/4pbcp/

also providing illustration code below.

<!doctype html> <html> <head> <title>jquery ui dialog: open dialog on clicksssssssssss</title> <link rel="stylesheet" href="../css/jquery-ui.css" /> <link rel="stylesheet" href="../css/style.css" /> <script type="text/javascript" src="../scripts/jquery.js"></script> <script type="text/javascript" src="../scripts/jquery-ui.js"></script> <script type="text/javascript" src="../scripts/jquery.validate.js"></script> <script type="text/javascript"> $(function(){ $("#pop_submit").click(function() { alert("am here"); //return false; }); }); </script> </head> <body> <div id="popup" style="display:block"> <form action="" name="pop_up_form" id="pop_up_form" method="post"> <input class="pop_up_textbox" type="text" name="acct_nmbr" id="acct_nmbr" required maxlength="19" value=""/> <input type="submit" name="pop_submit" id="pop_submit" style="display:block;" /> </form> </div> </body> </html>

here in jquery code have set alert while submitting button. need show alert after successful html 5 native validation. if 1 can point me out how can accomplish can phone call ajax function instead of alert message after successful html 5 native validation.

i know can utilize jquery validator validate form using valid() method don't wanna go in way. need know whether html 5 native validation successful , if need logic.

the checkvalidity() method (part of html5 validation api) should need. tutorial helpful in explaining native html5 form validation methods: http://www.html5rocks.com/en/tutorials/forms/constraintvalidation/.

jquery html5 jquery-ui

No comments:

Post a Comment