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..
var value = parseInt(txtssc); if (value) { if (value < 0 || value > 600) showThatValueIsNotInRange(value); } else // value could be NaN, then: showThatStringHasInvalidNumericFormat(txtssc);
show*
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)