<!-- This function is called to validate a field in a form, when the function is called the field that needs to be validated and the text to display if the field is not valid is specified -->
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}
<!-- This function is called to validate the value entered into the Email fieldof the table, when the function is called the field that needs to be validated and the text to display if the field is not valid is specified -->
function validate_Email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false}
else {return true}
}
<!-- This function is called when the form is submitted, it goes through and calls different functions to validate different field types, when calling the function it specifies the field to be validated and the text to display if the field is not valid -->
}function validate_form(thisform)
{
with (thisform)
{

if (validate_Email(Email,"Not a valid e-mail address!")==false)
{Email.focus();return false}

}
}