Issue
In my code for select validation
<span class="error" ng-show="mainForm.businessprocess.$error.required && submit">required</span>
and in the controller I have
$scope.submit=function(){
$scope.submit=true;
}
If I click on the button then the popup shows like normal HTML validation and Angular's validation is not working.
Here is a JSFiddle for the same: http://jsfiddle.net/priya78/nF7eJ/65/
If I remove the button and use
<span class="error" ng-show="mainForm.businessprocess.$error.required ">required</span>
then Angular's validation is working.
I want to show required in red text on click of button.
Solution
You have a few issues:
- Add
novalidate
to the<form>
tag - Rename the boolean
submit
property because you already have assigned this name to a function - Functions must be called explicitly (
ng-click="click()"
)
Final version: http://jsfiddle.net/nF7eJ/67/
Answered By - meze
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.