Purchase Solution

JavaScript function to validate a text-field on a form that is to hold an email address.

Not what you're looking for?

Ask Custom Question

Write a JavaScript function to validate a text-field on a form that is to hold an email
address. Now when writing this JavaScript function bear in mind that you won't be able
to fully validate it unless you manage to interrogate the server in which it's supposed to
reside. This is almost impossible, so the validation should check that the contents of the
text-field only looks like a valid email address.
email addresses look like the following
[email protected]
[email protected]
[email protected]
[email protected]
etc ...

Submit a html file with a form containing an email text-field, and the JavaScript code that
called to validate the text-field when the form is submitted. (so I can easily test it).

If you use sources from the Internet please submit a reference!!! Otherwise submit only original solutions!

Purchase this Solution

Solution Summary

Write a JavaScript function to validate a text-field on a form that is to hold an email
address.

Solution Preview

http://www.smartwebby.com/DHTML/email_validation.asp

<script language = "Javascript">
/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/

function echeck(str) {

var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
...

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.