...

View Full Version : validation



Kevin
03-02-2003, 01:09 AM
trying to use regexp against form elements like so...

function validate ()
{
var string = 12345;
var isAlpha = /^[a-z ]$/;
if( !isAlpha.document.forms.numbers.value)
alert (document.forms.numbers.value);
}

is this the right approach

thanx
Kevin

joh6nn
03-02-2003, 01:39 AM
been a while since i've worked with RE's, but, i think it should be:

function validate ()
{
var string = 12345;
var isAlpha = /^[a-z ]$/;
if( !isAlpha.test(document.forms.numbers.value))
alert (document.forms.numbers.value);
}

Kevin
03-02-2003, 03:14 AM
I appreciate the help

thank you
Kevin



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum