Thread: alert
View Single Post
  #2 (permalink)  
Old December 28th, 2003, 04:59 PM
Greg Griffiths Greg Griffiths is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Try something like :

var errors=0;
var errmsg="";

if (document.Form1.txtEmail.value.indexOf("@")==-1)
{
    errors=errors+1;
    errmsg=errmsg+"Please enter a valid Email Address.\n";
}

if (errors>0)
{
    alert("There were " + errors + " errors, they were :\n\n" + errmsg);
}

Reply With Quote