Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
password and the confirm password does not match yet the validation is not being triggered

What I have tried:

<pre>
		<div class="form-group" ng-class="{ 'has-error' : registrationForm.pwd.$invalid && !registrationForm.pwd.$pristine}">
		<label for="pwd">Password:</label>
		<input type="password" class="form-control" id="pwd" name="pwd"  placeholder="Enter Password" ng-model="userdetails.pwd" required />
		<span style = "color:red" ng-show = "registrationForm.pwd.$dirty && registrationForm.pwd.$invalid"> 
		<span ng-show = "registrationForm.pwd.$error.required">Password is required.</span>  
		</span>	
		</div>
		
		<div class="form-group" ng-class="{ 'has-error' : registrationForm.conpwd.$invalid && !registrationForm.conpwd.$pristine}">
		<label for="pwd">Confirm Password:</label>
		<input type="password" class="form-control" id="conpwd" name="conpwd"  placeholder="Enter Confirm Password" ng-model="userdetails.conpwd" ng-match="userdetails.pwd" required />
		<span style = "color:red" ng-show = "registrationForm.conpwd.$dirty && registrationForm.conpwd.$invalid"> 
		<span ng-show = "registrationForm.conpwd.$error.required">Password is required.</span>  
<span ng-show = "registrationForm.conpwd.$error.match">Password do not match..</span> 
		</span>	
		</div>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900