//-- D.Rothe-www.exsiteweb.com

//-- 19/04/2002

//-------------------------

//-- Begin field validation



function Reset() {

document.forms[0].elements[0].focus();

}

function submitForms() {

if ( (isName() ) && (isEmail()) &&  (isComment()))

if (confirm(""+document.forms[0].Name.value+"\nAre you are ready to e-mail the form?\n\nClick on OK to submit.\nClick on CANCEL to abort."))

{

}

else

{

alert("\n"+document.forms[0].Name.value+" you have chosen to cancel the submission.");

return false;

}

else

return false;

}

function isName() {

var str = document.forms[0].Telephone.value;

if (str == "") {

alert("\nThe Phone Number(s) field is blank.\n\nPlease enter a Phone Number.")

document.forms[0].Telephone.focus();

return false;

}

for (var i = 0; i < str.length; i++)

{

var ch = str.substring(i, i + 1);

if (((ch < "0" || "9" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ')

{

alert("\n-.\n\nPlease re-enter your phone number.");

document.forms[0].Telephone.select();

document.forms[0].Telephone.focus();

return false;

   }

}

return true;

}

function isEmail()

{

if (document.forms[0].Email.value == "") {

alert("\nThe E-MAIL field is blank.\n\nPlease enter your e-mail address.")

document.forms[0].Email.focus();

return false; 

}

if (document.forms[0].Email.value.indexOf ('@',0) == -1 ||

document.forms[0].Email.value.indexOf ('.',0) == -1)

{

alert("\nIncorrect E-mail format.\n\nPossible cause @ or . missing.\n\nPlease re-enter your e-mail address.")

document.forms[0].Email.select();

document.forms[0].Email.focus();

return false;

}

else

{

return true;

}

}



function isComment() {

if (document.forms[0].Comment.value == "") {

if (confirm("\n"+document.forms[0].Name.value+"\nDo you want to Submit without leaving a comment.\n\nClick on CANCEL to include a comment.\nor\nClick on OK to Submit without a comment."))

return true

else

{

document.forms[0].Comment.focus();

return false;      

}

}

else

return true   

}





// End -->

