Page 1 of 1

code not working

Posted: Sat Oct 20, 2007 8:07 pm
by Daron
This is just a snip of what I'm working on, but the problem I'm having is that when the code to the right of the || operands is gone, it works. What do I need to do to make it work?

Code: Select all

document.forms[0].onsubmit = function()
{
	if(this.elements['tax_id'].value.length < 9 || this.elements['tax_id'].value.match([^[:digit:]]))
			 {alert('Tax ID information is incorrect.')
			 return false;
			 }

Posted: Sat Oct 20, 2007 9:49 pm
by Christopher
Maybe:

Code: Select all

|| this.elements['tax_id'].value.match(/^[:digit:]/))