How to write validation for Range in asp.net using jQuery ?

Jul 2 2015 12:43 AM
Hi,
I have textboxes,one for ssc marks(0-600) and another is inter marks(0-1000)
I want to write validation for these two textboxes using jQuery.
What should I write in my Scripting??
The following code is What I wrote in my WebForm...
<script type="text/javascript">
function f1(){
var txtssc = $('[id*="txtssc"]').val();
var txtinter = $('[id*="txtinter"]').val();
if (txtssc == "") {
$('[id*="txtssc"]').notify("Marks should not be empty", { position: "top" });
$('[id*="txtssc"]').next().show();
return false;
}
if (txtinter == "") {
$('[id*="txtinter"]').notify("Inter Marks should not be empty", { position: "top" });
$('[id*="txtinter"]').next().show();
return false;
}
}
if (txtssc <=0&&txtssc>=600) {
$('[id*="txtssc"]').notify("Please enter valid SSC Marks ", { position: "top" });
$('[id*="txtssc"]').next().show();
return false;
if (txtinter <=0&&txtinter>=1000) {
$('[id*="txtssc"]').notify("Please enter valid Inter marks, { position: "top" });
$('[id*="txtssc"]').next().show();
return false;
<script/>
So,my problem is I should not enter less than 0 and greater than 600 and the warning message should display..
Please help me in this code..


Answers (4)