function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert("Invalid E-mail ID") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Invalid E-mail ID") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Invalid E-mail ID") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Invalid E-mail ID") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Invalid E-mail ID") return false } if (str.indexOf(dot,(lat+2))==-1){ alert("Invalid E-mail ID") return false } if (str.indexOf(" ")!=-1){ alert("Invalid E-mail ID") return false } return true } function validateform() { form = document.registration; text = form["first_name"]; if ( !text.value) { alert("Please enter your first name."); text.focus(); return false; } text = form["last_name"]; if ( !text.value ) { alert("Please enter your last name."); text.focus(); return false; } text = form["title"]; if ( !text.value ) { alert("Please enter your title."); text.focus(); return false; } text = form["company"]; if ( !text.value ) { alert("Please enter your company name."); text.focus(); return false; } text = form["address"]; if ( !text.value ) { alert("Please enter your address."); text.focus(); return false; } text = form["city"]; if ( !text.value) { alert("Please enter your city."); text.focus(); return false; } text = form["state"]; if ( !text.value) { alert("Please enter your state."); text.focus(); return false; } text = form["country"]; if ( !text.value) { alert("Please enter your country."); text.focus(); return false; } text = form["postcode"]; if ( !text.value) { alert("Please enter your zip code."); text.focus(); return false; } text = form["phone"]; if ( !text.value ) { alert("Please enter your company phone number."); text.focus(); return false; } /* text = form["email"]; if ( !text.value ) { alert("Please enter your e-mail address."); text.focus(); return false; }*/ var emailID=document.registration("email"); if(emailID.value.toLowerCase().indexOf("@hotmail.com")!=-1 || emailID.value.toLowerCase().indexOf("@yahoo.com")!=-1 || emailID.value.toLowerCase().indexOf("@msn.com")!=-1) { alert("Please use another e-mail address"); emailID.value="" return false } if ((emailID.value==null)||(emailID.value=="")){ alert("Please enter your e-mail address") emailID.focus() return false } if (echeck(emailID.value)==false){ // emailID.value="" emailID.focus() return false } text = form["type_mechanism"]; if ( !text.value ) { alert("Please enter the type of mechanism."); text.focus(); return false; } text = form["components_lubricated"]; if ( !text.value ) { alert("Please enter the components to be lubricated."); text.focus(); return false; } text = form["materials_construction"]; if ( !text.value ) { alert("Please enter the materials of construction."); text.focus(); return false; } text = form["type_touch"]; if (document.registration.lubricant_touch[0].checked && !text.value ) { alert("Please enter the type of component."); text.focus(); return false; } text = form["lowest_operating_temperature"]; if ( !text.value ) { alert("Please enter the lowest operating temperature."); text.focus(); return false; } text = form["highest_operating_temperature"]; if ( !text.value ) { alert("Please enter the highest operating temperature."); text.focus(); return false; } text = form["present_life"]; if ( !text.value ) { alert("Please enter the present operating life."); text.focus(); return false; } text = form["desired_life"]; if ( !text.value ) { alert("Please enter the desired operating life."); text.focus(); return false; } text = form["desired_life_hot"]; if ( !text.value ) { alert("Please enter the desired life at highest temp."); text.focus(); return false; } text = form["present_lubricant"]; if ( !text.value ) { alert("Please enter the present lubricant."); text.focus(); return false; } text = form["unsatisfactory"]; if ( !text.value ) { alert("Please indicate why unsatisfactory."); text.focus(); return false; } return true; }