By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,628 Members | 1,880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,628 IT Pros & Developers. It's quick & easy.

email validation script recommendations

P: n/a
Hello,
Is there a generally accepted technique for client-side email address
validation? Can someone point me to a good, widely-used and tested
script?
thanks,
-morgan
Aug 21 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Morgan Packard wrote:
Is there a generally accepted technique for client-side email address
validation?
I suppose

<script type="text/javascript">
/**
* Determines whether <code>s</codeis a syntactically
* valid e-mail address according to RFC2822, section 3.4.1.
*
* @param s : string
* Presumed e-mail address.
* @type boolean
* @return
* <code>true</codeif <code>s</codeis syntactically valid,
* <code>false</codeotherwise.
* @author TODO
*/
function isValidEmailAddr(s)
{
return ...
}

function isValidForm(f)
{
return isValidEmailAddr(f.elements['email'].value);
}
</script>

<form action="validate" onsubmit="return isValidForm(this)">
...
<input name="email" ...>
...
</form>

could qualify.
Can someone point me to a good, widely-used and tested script?
That depends on what you expect "e-mail address validation" to be.
Generally, that is unlikely; search the archives.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Aug 21 '08 #2

P: n/a
Morgan Packard wrote:
Is there a generally accepted technique for client-side email address
validation? Can someone point me to a good, widely-used and tested
script?

http://www.merlyn.demon.co.uk/js-valid.htm#VEmA

Hope this helps,

--
Bart
Aug 21 '08 #3

P: n/a
MP
Cool. Thanks.

-m-

On Aug 21, 11:34*am, Bart Van der Donck <b...@nijlen.comwrote:
Morgan Packard wrote:
Is there a generally accepted technique for client-side email address
validation? Can someone point me to a good, widely-used and tested
script?

*http://www.merlyn.demon.co.uk/js-valid.htm#VEmA

Hope this helps,

--
*Bart
Aug 21 '08 #4

P: n/a
Thomas 'PointedEars' Lahn wrote:
Morgan Packard wrote:
>Is there a generally accepted technique for client-side email address
validation?

I suppose

<script type="text/javascript">
/**
* Determines whether <code>s</codeis a syntactically
* valid e-mail address according to RFC2822, section 3.4.1.
*
* @param s : string
* Presumed e-mail address.
* @type boolean
* @return
* <code>true</codeif <code>s</codeis syntactically valid,
* <code>false</codeotherwise.
* @author TODO
*/
function isValidEmailAddr(s)
Those look like JS Doc comments.

In JSDocToolkit, the return type can be specified in {}. For example:

/**
...
* @return {boolean} true, if the address is valid
* @param {string} s input string
* ...

The types can also be displayed as a link, for a user defined type,
annotated "@class". JSDocToolkit will create a link to that type.

* @return {MyType} object representing input data.
*/

Garrett
>
PointedEars
Aug 21 '08 #5

P: n/a
dhtml wrote:
Thomas 'PointedEars' Lahn wrote:
>Morgan Packard wrote:
>>Is there a generally accepted technique for client-side email address
validation?
I suppose

<script type="text/javascript">
/**
* Determines whether <code>s</codeis a syntactically
* valid e-mail address according to RFC2822, section 3.4.1.
*
* @param s : string
* Presumed e-mail address.
* @type boolean
* @return
* <code>true</codeif <code>s</codeis syntactically valid,
* <code>false</codeotherwise.
* @author TODO
*/
function isValidEmailAddr(s)

Those look like JS Doc comments.
PointedEars' JSdoc[tm], to be precise.
In JSDocToolkit, the return type can be specified in {}.
It would appear that this notation is not supported by the IDE that I am
using. Is there are purpose to your advertising JSDocToolkit here?
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Aug 21 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.