How to disabled HTML5 validation using Angular.js

Share:
AngularJS Form Validation


Angular.js has the facility to restrict HTML5 validation. All input fields can validate against some basic HTML5 validations, like minimum length, maximum length, etc. These are entirely available on the new HTML5 attributes of a manikin.

It is usually a great idea to use the novalidate flag on the configuration factor. This will prevent the browser from submitting the form.

 <!DOCTYPE html>  
 <html>  
   <head>  
     <!-- CSS -->  
     <!-- load bootstrap -->  
     <link rel="stylesheet" href="css/bootstrap.min.css">   
     <style>  
       body      { padding-top:30px; }  
     </style>  
     <!-- JS -->  
     <!-- load angular -->  
     <script src="js/anguler_1.2.js"></script>   
     <script src="js/app.js"></script>  
   </head>  
   <body ng-app="formValidationApp" ng-controller="formController">  
     <div class="container">  
       <form name="signup_form" novalidate ng-submit="signupForm()">  
         <fieldset>  
           <legend>Signup</legend>  
           <button type="submit" class="button radius">Submit</button>  
         </fieldset>  
       </form>  
     </div>  
   </body>  
 </html>  

In the Above example we have put novalidate flag in <form> tag, which will prevent HTML validation.

No comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();

Ads