<div class="form-group">
<input type="text" name="Name"
data-ng-model="panNumber" required>
<p data-ng-show="loginForm.Name.$error.required && (loginForm.Name.$touched || submitted)"
class="error-block">Kindly enter your valid 10 digit PAN Number</p>
</div>
<button type="reset" data-ng-click="loginCtrl.reset()">RESET</button>
controller
this.reset = function(){
$scope.loginForm.$setPristine();
$scope.loginForm.$setValidity();
$scope.loginForm.$setUntouched();
};
I have several fields in a loginForm, the problem is when user clicks on submit button without entering any data in any of the fields , all the error messages (required) are getting displayed. But when I reset button , the error messages are still present, they are not getting cleared.
I tried to debug a lot but not able to find the solution.I do not know what mistake I am doing.
Any help is appreciated !!!
Thanks
submitted
?