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
Prasad Bhagat
NA
516
235.4k
validate minmum and maximum salaries
Aug 8 2014 3:18 AM
Dear all,
i have two asp.net textboxes
txtminsal,txtmaxsal,
user when enter the lessthan min salary i want disply alert
defualt.aspx
-------------------
<script type="text/javascript">
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
alert("enetr numbers");
return false;
}
return true;
}
function Button1_onclick() {
var a = document.getElementById('TextBox1').value;
var b = document.getElementById('TextBox2').value;
if (b < a) {
alert('Maxsal is should be greater than minsal');
return true;
}
else {
return false;
}
}
</script>
</head>
<body>
<form runat="server">
<asp:TextBox ID="TextBox1" runat="server" onkeypress="return isNumber(event)"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" onkeypress="return isNumber(event)" OnTextChanged="Button1_onclick()"></asp:TextBox>
</form>
</body>
</html>
this code is not working
pls help me asap
Reply
Answers (
4
)
Change color of selected menu
calling second condition in content pages using onBlur event