96turnerri
11-29-2003, 10:39 AM
hi i have made this script which validates my form, it validates ok but when correction has been made to a missed field on the form, so it should now pass it doesnt :confused: can anyone see whats wrong with this code? thanks 96
<script type="text/javascript">
function validate() {
if (document.quotation.Name.value.length < 5) {
alert("Please Enter Your Full Name.");
document.quotation.Name.focus();
return false;
}
if (document.quotation.Email.value.length < 10) {
alert("Please Enter Your Full Email Address.");
document.quotation.Email.focus();
return false;
}
if (document.quotation.Domain[0].checked) {
if (document.quotation.DomainName.value.length < 10);
alert("Please Enter An Example Of A Domain Name.");
document.quotation.DomainName.focus();
return false;
}
if (document.quotation.ExistingSite[0].checked) {
if (document.quotation.ExistingURL.value.length < 15);
alert("Please Enter Your Existing Sites URL.");
document.quotation.ExistingURL.focus();
return false;
}
if (document.quotation.Updates[0].checked) {
if (document.quotation.Update.options == document.quotation.Update.defaultSelected);
alert("Please Choose Update Frequency.");
document.quotation.Update.options.focus();
return false;
}
if (document.quotation.LogoColour[1].checked) {
if (document.quotation.ColoursLogo.options == document.quotation.ColoursLogo.defaultSelected);
alert("Please Choose Company Colour / Logo Design Type.");
document.quotation.ColoursLogo.options.focus();
return false;
}
if (document.quotation.Forms.checked) {
if (document.quotation.forms.options == document.quotation.forms.defaultSelected);
alert("Please Select The Number Of Forms You Require.");
document.quotation.forms.options.focus();
return false;
}
return true;
}
</script>
<script type="text/javascript">
function validate() {
if (document.quotation.Name.value.length < 5) {
alert("Please Enter Your Full Name.");
document.quotation.Name.focus();
return false;
}
if (document.quotation.Email.value.length < 10) {
alert("Please Enter Your Full Email Address.");
document.quotation.Email.focus();
return false;
}
if (document.quotation.Domain[0].checked) {
if (document.quotation.DomainName.value.length < 10);
alert("Please Enter An Example Of A Domain Name.");
document.quotation.DomainName.focus();
return false;
}
if (document.quotation.ExistingSite[0].checked) {
if (document.quotation.ExistingURL.value.length < 15);
alert("Please Enter Your Existing Sites URL.");
document.quotation.ExistingURL.focus();
return false;
}
if (document.quotation.Updates[0].checked) {
if (document.quotation.Update.options == document.quotation.Update.defaultSelected);
alert("Please Choose Update Frequency.");
document.quotation.Update.options.focus();
return false;
}
if (document.quotation.LogoColour[1].checked) {
if (document.quotation.ColoursLogo.options == document.quotation.ColoursLogo.defaultSelected);
alert("Please Choose Company Colour / Logo Design Type.");
document.quotation.ColoursLogo.options.focus();
return false;
}
if (document.quotation.Forms.checked) {
if (document.quotation.forms.options == document.quotation.forms.defaultSelected);
alert("Please Select The Number Of Forms You Require.");
document.quotation.forms.options.focus();
return false;
}
return true;
}
</script>