473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

email validation script recommendations

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
5 1347
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Phil Powell | last post by:
Where can I find an online PHP form validator script library to use? I have tried hacking the one here at work for weeks now and it's getting more and more impossible to customize, especially now...
1
by: Greg Bryant | last post by:
Hi folks. I'm porting a cf site to php, everything's going very well, I like php much better (this, of course, being the correct forum to make that statement :). One problem I have is with...
25
by: Dynamo | last post by:
Hi The following script was taken from John Coggeshall's (PHP consultant) in his article on Zends site at http://www.zend.com/zend/spotlight/ev12apr.php // Get the email address to validate...
2
by: Rasmus Marcussen | last post by:
hello i friend of mine has made this page: http://home1.stofanet.dk/samtaleterapi/home.htm it validates like this:...
2
by: Tim Mills | last post by:
The following code asks the user to sumbit a name, email address, and some text for a quotation via a FORM. I have written a javascript function to evaluate the fields in the form and pop-up a...
6
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No...
2
by: Dnna | last post by:
I have a table which is bound to an Internet Explorer XML data island. I'm using ASP.NET's client-side validators for an input field in the table. The problem is that if the input fields are in...
4
by: ianbarton | last post by:
Hello all I am trying to setup a feedback form on my webpage using some script provided by my ISP. I really don't know a lot about PHP and it's syntax etc. The feedback form only has 4...
13
by: Andrew Falanga | last post by:
HI, Just a warning, I'm a javascript neophyte. I'm writing a function to validate the contents of a form on a web page I'm developing. Since I'm a neophyte, this function is quite simple at...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.