
<!--
function Form1_Validator(theForm)
{

var alertsay = ""; // define for long lines


// check to see if the field is blank
if (theForm.name.value == "")
{
alert("U bent verplicht uw naam in te vullen.");
theForm.name.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.name.value.length < 3)
{
alert("Graag minimaal 3 karakters in het \"naam\" veld invullen.");
theForm.name.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZĊÄÖ abcdefghijklmnopqrstuvwxyzċäö-0123456789";
var checkStr = theForm.name.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Graag alleen letters en numerieke karakters in het \"naam\" veld invullen.");
theForm.name.focus();
return (false);
}


if (theForm.text.value == "")
{
alert("U bent verplicht een tekst in te voeren.");
theForm.text.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.text.value.length < 3)
{
alert("Graag minimaal 3 karakters in het \"tekst\" veld invullen.");
theForm.text.focus();
return (false);
}



if (theForm.title.value == "")
{
alert("U bent verplicht een titel in te vullen.");
theForm.title.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.title.value.length < 3)
{
alert("Graag minimaal 3 karakters in het \"titel\" veld invullen.");
theForm.title.focus();
return (false);
}




// require at least 5 characters in the password field
if (theForm.Password.value.length < 5)
{
alert("Graag minimaal 5 karakters in het \"Password\" veld invullen.");
theForm.Password.focus();
return (false);
}

// check if both password fields are the same
if (theForm.Password.value != theForm.Password2.value)
{
	alert("De twee passwords zijn niet hetzelfde.");
	theForm.Password2.focus();
	return (false);
}

// allow only 1000 characters maximum in the text field
if (theForm.text.value.length > 3000)
{
alert("Graag maximaal 3000 karakters in het text veld invullen. Dank U.");
theForm.text.focus();
return (false);
}

// check if no drop down has been selected concerning INTEREST
if (theForm.interest.selectedIndex < 0)
{
alert("Selecteer een keuze van de optie \"Interest\" .");
theForm.interest.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (theForm.interest.selectedIndex == 0)
{
alert("De eerste optie \"Interest\" is geen valide keuze.");
theForm.interest.focus();
return (false);
}


// check if no drop down has been selected
if (theForm.state.selectedIndex < 0)
{
alert("Selecteer uit de \"Provincie/Land\" optie uw keuze.");
theForm.state.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (theForm.state.selectedIndex == 0)
{
alert("De eerste optie \"Provincie/Land\" is geen valide keuze.");
theForm.state.focus();
return (false);
}


// check if no drop down has been selected
if (theForm.category.selectedIndex < 0)
{
alert("Selecteer uit de \"Categorie\" optie uw keuze.");
theForm.interest.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (theForm.category.selectedIndex == 0)
{
alert("The first \"category\" option is not a valid selection.");
theForm.category.focus();
return (false);
}


// check if email field is blank
if (theForm.Email.value == "")
{
alert("Wilt u zo vriendelijk zijn het \"Email\" veld in te vullen.");
theForm.Email.focus();
return (false);
}


// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.Email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid)
{
alert("Het \"email\" veld moet het volgende bevatten \"@\" en een \".\".");
theForm.Email.focus();
return (false);
}


// check if numbers field is blank
if (theForm.phone.value == "")
{
alert("Wilt u zo vriendelijk zijn het \"telefoon\" veld in te vullen.");
theForm.phone.focus();
return (false);
}

// only allow numbers to be entered
var checkOK = "012345 -6789";
var checkStr = theForm.phone.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Graag alleen maar nummers gebruiken in het \"telefoon\" veld.");
theForm.phone.focus();
return (false);
}



// alert if the box is NOT checked
if (!theForm.checkbox1.checked)
{
alertsay = "Hierbij wil ik u attenderen dat u akkoord moet gaan met de condities van overeenkoming alvorens u hier wilt adverteren."
alert(alertsay);
}

}



//-->