function validscript()
{
var fname = document.getElementById("fname") ;
var lname = document.getElementById("lname") ;
var number = document.getElementById("number") ;
var email = document.getElementById("email") ;
var confemail = document.getElementById("confemail") ;
var street = document.getElementById("street") ;
var city = document.getElementById("city") ;
var state = document.getElementById("state") ;
var zip = document.getElementById("zip") ;
if (fname.value ="")
{
alert ("Please enter a valid first name.");
}
if (lname.value ="")
{
alert ("Please enter a valid last name.");
}
if (number.value ="")
{
alert ("Please enter a valid phone number.") ;
}
if (email.value ="")
{
alert ("Please enter a valid email address.") ;
}
if (confemail.value ="")
{
alert ("Please enter a valid confirmation email address.") ;
}
if (street.value ="")
{
alert ("Please enter a valid street address.") ;
}
if (city.value ="")
{
alert ("Please enter a valid city.") ;
}
if (state.value ="")
{
alert ("Please select a state.") ;
}
if (zip.value ="")
{
alert ("Please enter a valid zip code.") ;
}
if (alert () == "")
{
return false;
}
else
{
return true;
}
var boxesChked = ""
for (i = document.getElementsByName('sr[]').length - 1; i >= 0; i--)
{
if (document.getElementsByName('sr[]')[i].checked)
{
boxesChked = boxesChked + document.getElementsByName('sr[]')[i].value + "\n"
}
}
if (boxesChked == "")
{
alert ("You must select a box to continue.");
return false;
}
else
{
<!--alert (boxesChked)-->
return true;
}
}
It still allows the form to be submited and none of the alerts show up.