All pastes #945092 Raw Edit

Someone

public javascript v1 · immutable
·published 2008-03-16 18:13 UTC
rendered paste body
<script language="JavaScript">function Validator(eccyc){  var error = "";  if (eccyc.session.options[0].selected == true)  {    error += "Please select a session from the drop-down list.\n";  }  if eccyc.gender.options[0].selected == true)  {    error += "Please select your gender from the drop-down list.\n";  }  if (eccyc.emname.value == "")  {    error += "Please enter the name of your Emergency Contact.\n";  }  if (eccyc.last.value == "")  {    error += "Please enter your last name.\n";  }  if (eccyc.first.value == "")  {    error += "Please enter your first name.\n";  }  if (eccyc.middle.value == "")  {    error += "Please enter your middle name.\n";  }  if (eccyc.street.value == "")  {    error += "Please enter your address.\n";  }  if (eccyc.city.value == "")  {    error += "Please enter your city.\n";  }  if (eccyc.email.value == "")  {    error += "Please enter your email.\n";  }    if (eccyc.emrelation.value == "")  {    error += "Please enter your relationship to the Emergency Contact.\n";  }   var digits = "0123456789";  if (eccyc.emdaytel.value == "")  {    error += "Please enter your Emergency Contact's day number.\n";  }  if (eccyc.emdaytel.value.length < 10)  {   	error += "You did not enter a complete number in the emergency day telephone section.\n";  }  for (var i = 0; i < eccyc.emdaytel.value.length; i++)  {    temp = eccyc.emdaytel.value.substring(i, i+1)    if (digits.indexOf(temp) == -1 &&     eccyc.emdaytel.value != "")    {      error += "You must enter only numbers in the day telephone.\n";      break;    }}	if (eccyc.emevetel.value == "")  {    error += "Please enter your Emergency Contact's evening number.\n";  }  if (eccyc.emevetel.value.length < 10)  {   	error += "You did not enter a complete number in the emergency evening telephone section.\n";  }  for (var i = 0; i < eccyc.emevetel.value.length; i++)  {    temp = eccyc.emevetel.value.substring(i, i+1)    if (digits.indexOf(temp) == -1 &&     eccyc.emevetel.value != "")    {      error += "You must enter only numbers in the evening telephone.\n";      break;    }}		if (eccyc.hometel.value == "")  {    error += "Please enter your home telephone number.\n";  }  if (eccyc.hometel.value.length < 10)  {   	error += "You did not enter a complete number in the home telephone section.\n";  }  for (var i = 0; i < eccyc.hometel.value.length; i++)  {    temp = eccyc.hometel.value.substring(i, i+1)    if (digits.indexOf(temp) == -1 &&     eccyc.hometel.value != "")    {      error += "You must enter only numbers in the home telephone.\n";      break;    }}		if (eccyc.mobiletel.value == "")  {    error += "Please enter your mobile number.\n";  }  if (eccyc.mobiletel.value.length < 10)  {   	error += "You did not enter a complete number in the mobile telephone section.\n";  }  for (var i = 0; i < eccyc.mobiletel.value.length; i++)  {    temp = eccyc.mobiletel.value.substring(i, i+1)    if (digits.indexOf(temp) == -1 &&     eccyc.mobiletel.value != "")    {      error += "You must enter only numbers in the mobile telephone section.\n";      break;    }}		if (eccyc.zip.value == "")  {    error += "Please enter your zip code.\n";  }  if (eccyc.zip.value.length < 5)  {   	error += "You did not enter a complete number in the zip code section.\n";  }  for (var i = 0; i < eccyc.zip.value.length; i++)  {    temp = eccyc.zip.value.substring(i, i+1)    if (digits.indexOf(temp) == -1 &&     eccyc.zip.value != "")    {      error += "You must enter only numbers in the zip code section.\n";      break;    }  }	}  </script>