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