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
Sai
NA
203
30k
Validation for html controls
Aug 2 2017 6:40 AM
Hi,
I have a query ..
i have a text box[ taken for age]
@Html.TextBox("Age", string.Empty, new { @class = "ControlWidth", ng_model = "age" , ng_keypress = "onlyNumbers($event)", type = "
number
", min=1 ,max=100 })
The above code display Spinner input control [type = "
number
"]
if i don't give any input and click on save button, then the validation error message executed successfully.See below is my validation code
if ($scope.age == "" || $scope.age==null ) {
$scope.errormsg = "Please Enter Age";
return false;
}
but if i given more than 100 like 101 then my validation message is not working. see below code.
if ($scope.age <1 || $scope.age>100 ) {
$scope.errormsg = "Range is 1 to 100 only";
return false;
}
Please find the below attachment.
Thanks in advanced
Attachment:
AgeValidation.zip
Reply
Answers (
2
)
asp.net web forms and api
How to update database table when the same item is selected inside combobox