I need to check whether HTML 5 native validation is successful or not. Based on this I need to call an ajax function.
An example code is here. http://jsfiddle.net/inDiscover/4Pbcp/
Also providing the example code as 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 the jquery code I have put an alert while submitting the button. But I need to show this alert only after successful HTML 5 native validation. If any one can point me out that is how can I achieve this then I can call an ajax function instead of an alert message after successful HTML 5 native validation.
I know we can use JQuery Validator to validate a form by using valid() method but I don't wanna go in that way. I need to know whether my HTML 5 native validation is successful and if it is I need to do some logic.