I am new in javascript and I have been stumped by this problem.
I have been through a lot of the prior posts and perhaps missed the answer but my question is a bit different, I have a form which I need to validate the user's input entries, most of the entries are numbers in the same range, another is % so it must be between 1 and 100 (the formula divides it by 100 so the user does not put in a decimal.
Actually between 1 and 10 (10% is the max)
My html for one of the inputs is:
<input style="" name="size" id="size" class="inp" value="25000" onblur="sqftvalidate();">
(If I need to post the entire page or table, please let me know)
the function is:
<script>
/* Test function with size input line 499 */
function sqftvalidate(x)
{
if(isNaN(x)||x<1000||x>100000)
{
alert("Value good "); // to test if validation is working
//docalculation(); this is the function to call if the validation is good
return true;
}
else
{
alert("Value must be between 1,000 and 1,000,000");
return false;
}
}
</script>
<!-- validate input functions end -->
onblur="sqftvalidate(this.value);".