function hasText(strFormField,strMessage)
{
var iAt=0, strValue="", strFiltered="";
strValue = eval('document.forms[2].' + strFormField + ".value") ;
for(iAt=0;iAt<strValue.length+1;iAt++)
{
if (strValue.substring(iAt,iAt+1) != " ")
{
strFiltered = strFiltered + strValue.substring(iAt,iAt+1) ;
}
}
if (strFiltered == "")
{
alert("You must complete the " + strMessage + " field.");
eval('document.forms[2].' + strFormField + ".focus()") ;
return false ;
}
return true;
}
function hasSelection(strFormField,strMessage)
{
var iValue=0 ;
strValue = eval('document.forms[2].' + strFormField + ".selectedIndex") ;
if (strValue == 0)
{
alert("You must select an option from the " + strMessage + " field.");
eval('document.forms[2].' + strFormField + ".focus()") ;
return false ;
}
return true;
}
function validateForm()
{
if(!hasText("name","Name")){
return false;
}
if(!hasText("contact_email","Email Address")){
return false;
}
if(!hasSelection("pass","Password")){
return false;
}		 
return true;
}
