posted 17 years ago
hello, i currently have an input element, which has an onklick function which would check for validity of input (accepting only a number or the values "min" or "max"). how do i do that? as of now, i could only check whether it is a number or not, but once i enter "max" or "min", they don't get accepted but they should be... how do i do that? thanks! this is my current code for the function:
function loopHandler(i)
{
if(isNaN(i.value) || i.value != "max" || i.value != "min")
{
alert ("Invalid input. Choose from any number, 'max' or 'min' ");
i.clear();
}
else
{
alert ("ok");
}
}
thanks thanks!