Hello
I am having an issue getting this regular expression to work in IE 7. This code works perfect in FireFox & Netscape, but it does not work in IE7. The error IE 7 gives me is:
Function Expected
Below is the code. Does anyone know why I am getting this error?
Code:<html> <head> <script language="JavaScript"> function test() { //-- Regular Expression to validate the entered Zip Code regZip = new RegExp(/(^\d{5}$)/); if( regZip( document.getElementById("zipCode").value ) ) { alert("Thank you for entering a valid Zip Code"); } else { alert("Entered Zip Code is not valid."); } } </script> </head> <body> <input type="Text" id="zipCode" /> <input type="Button" value="validate" onClick="test();" /> </body> </html>




Bookmarks