.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> JQuery >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

html5 form validation via JQuery

Posted By:Sasi Prabhu       Posted Date: April 15, 2015    Points: 40    Category: JQuery    URL: http://www.dotnetspark.com  

Check default HTML5 form Validation using jQuery

<!DOCTYPE html>
  <title>Page Title</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js">

  <h1>This is a Heading</h1>
<input id="txt" type="text" placeholder="Enter Text" required />
<input type="submit" value="submit" /><label id="lbl"></label>
<button id="btnCheck" type="button">Check the Form Validation</button>



$('#lbl').text($('form')[0].checkValidity()); }); }); </script>

checkValidity() - used to Check the Validation status. It will return true/false.

Happy Coding..


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend