I am using alert to return to a form if it is not filled out correctly. For example, I have a field for quantity that must be from 1 to 99. My code is:
temp = document.item0.QTY.value;
if (temp > 0 && temp < 100) {
...
} else {
alert ("Select a numeric Quantity greater than 0 and less than 100"
;
document.item0.QTY.focus();
document.item0.QTY.select();
return false;
But when I click OK on the popup window, it goes back to the top of my web page instead of to this field in the form. What am I doing wrong? Do I have something missing on the form?
Thanks!
temp = document.item0.QTY.value;
if (temp > 0 && temp < 100) {
...
} else {
alert ("Select a numeric Quantity greater than 0 and less than 100"
document.item0.QTY.focus();
document.item0.QTY.select();
return false;
But when I click OK on the popup window, it goes back to the top of my web page instead of to this field in the form. What am I doing wrong? Do I have something missing on the form?
Thanks!