I have a simple regex check problem for an integer value. I found the following on this site:
<HTML> <HEAD> <script language="JavaScript"> function check_integer(el) { var intRegex = /^d+$/; var num=el.value; if(!intRegex.test(num)) { alert('must be an integer.'); } } </script> </head> <body> <form> <input type="text" name="f" onchange="check_integer(this)"> </form> </body></html>
If I type 5 in a field, and then click outside the field, it says not an integer. Tried Firefox and Chrome.
source share