title: Disable default form input error in angular js
body: <p>How do I disable the input error message showing by default below the text input  boxes. </p>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;script src="${pageContext.request.contextPath}/js/Registratonvalidation.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"&gt;
          &lt;script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
          &lt;script&gt;
              angular.module('myApp', []).controller("numOnlyRegex", function ($scope)
              {
              $scope.numOnlyRegex = /^\d{1,6}$/;
                      $scope.cityArray = ["hyderabad", "secunderabad", "delhi", "mumbai"];
              }
              .controller('FormSubmitController', function($scope) {
              $scope.submit = function($event)
              {
              if ($scope.myForm.$invalid)
              {
              $scope.myForm.$submitted = true;
                      $event.preventDefault();
              }
              });        &lt;/script&gt;
      &lt;!--&lt;script src="${pageContext.request.contextPath}/numOnlyRegex.js"&gt;&lt;/script&gt;--&gt;
          &lt;title&gt;Registration Form&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="container"&gt;
              &lt;div class="col-md-6 col-md-offset-3"&gt;
                  &lt;div class="panel panel-login"&gt;
                      &lt;div class="panel-body"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-lg-12"&gt;
                                  &lt;h2 class="text-muted"&gt;Registration form&lt;/h2&gt;
                                  &lt;!--onSubmit="return validate()"--&gt;
                                  &lt;div ng-app="myApp" ng-controller="FormSubmitController" &gt;
                                      &lt;form name="myForm" action="RegistrationServlet.do" method="POST" &gt;
                                          First name:&lt;input type="text" class="form-control input-sm" name="uname" ng-pattern="/^[a-zA-Z]{3,20}/" ng-model="uname" placeholder="First Name" required/&gt;
                                          &lt;span style="color:red" ng-show="myForm.uname.$error.pattern"&gt;First name cannot be less than 3 letters with no digits&lt;/span&gt;
                                          &lt;!--&lt;p ng-show="myForm.uname.$invalid &amp;&amp; !userForm.name.$pristine" class="help-block"&gt;Your name is required.&lt;/p&gt;--&gt;
                                          &lt;br/&gt;                                        
                                          Last name:&lt;input type="text" class="form-control input-sm" name="lname" ng-model="lname" name="uname" ng-pattern="/^[a-zA-]{3,20}/" required placeholder="Last Name"/&gt;
                                          &lt;span style="color:red" ng-show="myForm.lname.$error.pattern"&gt;First name cannot be less than 3 letters with no digits&lt;/span&gt;&lt;br/&gt;
                                          &lt;p&gt;Password:
                                              &lt;input type="password" class="form-control input-sm glyphicon glyphicon-ok" name="pwd" ng-minlength="3" ng-model="pwd" required placeholder="Password"/&gt;
                                              &lt;span style="color:red" ng-show="myForm.pwd.$error.minlength"&gt;password cannot be less than 3 letters&lt;/span&gt;&lt;br/&gt;
                                              Confirm Password:&lt;input type="password" class="form-control input-sm glyphicon glyphicon-ok" name="pwd2" ng-minlength="3" ng-model="pwd2" required placeholder="Confirm Password"/&gt;&lt;br/&gt;
                                              &lt;span style="color:red" ng-show="myForm.pwd2.$error.minlength"&gt;password cannot be less than 3 letters&lt;/span&gt;&lt;br/&gt;
                                              Gender: &lt;input type="radio" name="female" ng-model="color" value="female" ng-required="!color"/&gt;Female &lt;input type="radio" name="male" ng-model="color" value="male" ng-required="!color"/&gt;Male &lt;br/&gt;&lt;br/&gt;
                                              Mobile:&lt;input type="text" class="form-control input-sm" name="mobile" ng-pattern="/^[7-9][0-9]{1,9}$/" ng-model="mobile" required placeholder="Mobile"/&gt;
                                              &lt;span style="color:red" ng-show="myForm.mobile.$error.pattern"&gt;Please enter a valid mobile number&lt;/span&gt;&lt;br/&gt;
                                              Email:&lt;input type="email" class="form-control input-sm" name="email" ng-pattern="/\S+@\S+\.\S+/" ng-model="email" required placeholder="Email"/&gt;
                                              &lt;span style="color:red" ng-show="myForm.email.$error.pattern"&gt;Invalid email address&lt;/span&gt;&lt;br/&gt;
                                              Address:&lt;textarea class="form-control input-sm" name="address" ng-model="address" required placeholder="Address"&gt;&lt;/textarea&gt;
                                              &lt;span style="color:red" ng-show="myForm.address.$error.require == true"&gt;Address cannot be empty&lt;/span&gt;&lt;br/&gt;
                                              Street:&lt;input type="text" class="form-control input-sm" name="street" ng-model="street" required placeholder="Street"/&gt;
                                              Area:&lt;input type="text" class="form-control input-sm" name="area" ng-model="area" required placeholder="Area"/&gt;&lt;br/&gt;
  
                                              City: &lt;select name="citySelection" ng-model="city" ng-options="city for city in cityArray" name='city' required&gt;
                                                  &lt;option value=""&gt;Select city&lt;/option&gt;
                                              &lt;/select&gt;
                                              &lt;span ng-show="myForm.citySelection.$error.required"&gt;&lt;/span&gt;
                                              &lt;br/&gt;&lt;br/&gt;
  
                                              State: &lt;input type="text" class="form-control input-sm" name="state" ng-model="state" required placeholder="State"/&gt;
                                              Country: &lt;input type="text" class="form-control input-sm" name="country" ng-model="country" required placeholder="Country"/&gt;
                                              Pin:&lt;input type="text" class="form-control input-sm" ng-pattern="numOnlyRegex" name="pin" ng-model="pin" required placeholder="Pin"/&gt;
                                              &lt;span style="color:red" ng-show="myForm.pin.$error.pattern"&gt;Only six-digit number is allowed&lt;/span&gt;
                                              &lt;!--&lt;input type="Submit" class="form-control btn btn-success" ng-submit="submit($event)" value="Submit" /&gt;--&gt;
                                              &lt;button type="submit" class="form-control btn btn-success" ng-click="submit($event)"&gt;Submit&lt;/button&gt;
                                              &lt;!--ng-disabled="myForm.$invalid"--&gt;
                                      &lt;/form&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;            
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Link for the <a href="http://plnkr.co/edit/tHvYYwIHECveA4Salxpy?p=preview" rel="nofollow">plunker</a></p>