function validate_form () { if (document.Subscribe.email_from.value!="") { if (document.Subscribe.email_from.value.indexOf("@")==-1 || document.Subscribe.email_from.value.indexOf(".")==-1 || document.Subscribe.email_from.value.indexOf(" ")!=-1 || document.Subscribe.email_from.value.length<6) {alert("Sorry, your e-mail address is not valid.\r\n"); document.Subscribe.email_from.focus();return false} } if(document.Subscribe.email_from.value.length <1) {alert("You must enter a valid e-mail address.\r\n") document.Subscribe.email_from.focus();return false} if(document.Subscribe.Name.value.length <1) {alert("You left the Name field blank") document.Subscribe.Name.focus();return false} if(document.Subscribe.Postcode.value.length <1) {alert("You left the Postcode field blank") document.Subscribe.Postcode.focus();return false} if(document.Subscribe.Phone.value.length <3) {alert("You must enter a complete main phone number.") document.Subscribe.Phone.focus();return false} if(document.Subscribe.Referer.value.length <1) {alert("You left the How Did You Find Us field blank") document.Subscribe.Referer.focus();return false} }