Want to build the ChatGPT based Apps? Start here
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Prasad Bhagat
1.7k
516
212.7k
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