TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anilananda Chakrabortty
NA
425
78k
angular validation
Aug 3 2017 8:28 AM
<form>
<h2 class="text-primary text-center">Registration Page for Student</h2><br />
<div ng-form="subForm">
<div class="form-group ">
<div class="has-feedback" ng-class="{'has-error':subForm.name.$error.required && !subForm.name.$pristine && !subForm.name.$submitted}">
<input type="text" name="name" ng-model="register.Email" class="form-control" placeholder="Enter EmailId" required />
<i class="form-control-feedback glyphicon glyphicon-envelope"></i>
<p ng-show="subForm.name.$error.required && !subForm.name.$pristine && !subForm.name.$submitted" class="help-block">This field is required.</p>
</div>
</div>
<div class="form-group ">
<div class="has-feedback" ng-class="{'has-error':subForm.pass.$error.required && !subForm.pass.$pristine }">
<input type="text" name="pass" ng-model="register.Password" class="form-control" placeholder="Enter Password" required />
<i class="form-control-feedback glyphicon glyphicon-lock"></i>
<p ng-show="subForm.pass.$error.required && !subForm.pass.$pristine" class="help-block">This field is required.</p>
</div>
</div>
</div>
<input id="Text1" ng-model="register.Name" class="form-control" placeholder="Enter Name" type="text" /><br />
<input id="Text1" ng-model="register.Address" class="form-control" placeholder="Enter Address" type="text" /><br />
<input id="Text1" ng-model="register.City" class="form-control" placeholder="Enter City" type="text" /><br />
<input id="Button1" ng-click="savedata()" class="form-control btn btn-primary" type="button" value="{{btnText}}" />
</form>
========The above code is working ...but the problem is in validation...
i design this form as a registration page ...after click in the button (for savedata()) i did'nt redirect in any page ,,, i want to stay in the same page ...
so befoure clicking the button the angular validation is working , and its showing proper message also ....
but after click (after data saving) also that previous error message is comming (form validation message...)...
how to solve this problem.....?????
Reply
Answers (
3
)
How to showa bootstrap alert inside anguularjs post method
Problem in insert dropdown value in asp.mvc using angularjs