If the following line will force the user to input only a number
between 1 and 5, and will give an error to any keypress outside that
range:
onkeyup="if(eve nt.srcElement.v alue.search(new RegExp('^[1-5]$')))
{alert('Please type in a number between 1 and
5');event.srcEl ement.value=''; return false}"
.... how could I get the regular expression to accept 1 to 5 *or* the
Enter/Return keypress? I have tried ('^[1-5][\r]$') but that doesn't
work. Is there a syntax for saying "1 to 5 or Enter/Return"?
Thank you for any info you can give.
Steve
Comment