Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-02-2009, 01:41 PM   PM User | #1
xherry
New Coder

 
Join Date: Dec 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
xherry is an unknown quantity at this point
Email validation with javascript

This are my codes..


var add = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var email = form.txtEmail.value;
if (add.test(email) = false)
{
alert("Please enter a valid email.");
return false;
}
return true;
}


bt it wun work.. pls help..
xherry is offline   Reply With Quote
Old 12-02-2009, 04:44 PM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
See, what you've done there is... well, several things.

Firstly, you've dropped a question containing no reference to any known javascript frameworks, into a forum for javascript frameworks.

Secondly, you've posted a tantalising snippet of code; an appetite-whetter, the javascript equivalent of a saucy flash of leg, but no indication of how, where or when this code runs, or what you're expecting it to do when it does.

And finally, you've signed off with that most helpful of requests for aid: "It don't work".

I'd suggest a brief trip to the posting guidelines, followed by a revisitation of your request. Try to include some as much helpful information as you can. This may include, but is not necessarily limited to:
  • A link to where we can see the thing running.
  • An expanded code snippet, illustrating how the code is being called and what is being sent to it when it is.
  • A summary of what you'd like to happen, and a description of what actually happens.
  • Some punctuation.
Spudhead is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:22 AM.


Advertisement
Log in to turn off these ads.