I'm trying to use JavaScript to validate an email address and I want to find
the position of the period (".") in the address. When I pass it a valid
address like:

        [EMAIL PROTECTED] ( = email)

and I have in my function:

var vat = email.search("@");
var vdot = email.search(".");

vat is equal to 4 and vdot is equal to 0 (zero)!

email.substr(0,1) gives me "d" as it should.

Why can't it give me the correct index of a period? Is there a way to test
for the ascii value?

Any help is MUCH appreciated.

Thanks,
Duncan Hays
Peace Corps


------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to