FlagSource
0
loading...

Office Address

FlagSource

Write A Comment

function validateForm() { var name = document.forms["subFrm"]["name"].value; var coname = document.forms["subFrm"]["coname"].value; var email = document.forms["subFrm"]["email"].value; var phone = document.forms["subFrm"]["phone"].value; var message = document.forms["subFrm"]["message"].value; var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if(name=='') { document.getElementById("error-name").innerHTML="Please Enter Your Name"; document.forms["subFrm"]["name"].focus(); return false; } else{ document.getElementById("error-name").innerHTML=""; } if(coname=='') { document.getElementById("error-coname").innerHTML="Please Enter Company Name"; document.forms["subFrm"]["coname"].focus(); return false; } else{ document.getElementById("error-coname").innerHTML=""; } if(email=='') { document.getElementById("error-email").innerHTML="Please Enter Your Email"; document.forms["subFrm"]["email"].focus(); return false; }else{ document.getElementById("error-email").innerHTML=""; } if (!filter.test(email)) { document.getElementById("error-email").innerHTML="Please Provide a Valid Email"; document.forms["subFrm"]["email"].focus(); return false; }else{ document.getElementById("error-email").innerHTML=""; } if(phone=='') { document.getElementById("error-phone").innerHTML="Please Enter Your Contact"; document.forms["subFrm"]["phone"].focus(); return false; } else{ document.getElementById("error-phone").innerHTML=""; } if(phone!="") { if(isNaN(phone)||phone.indexOf(" ")!=-1) { document.getElementById("error-phone").innerHTML="Phone number Should Be Numeric"; document.forms["subFrm"]["phone"].focus(); return false; } else{ document.getElementById("error-phone").innerHTML=""; } } if(message=='') { document.getElementById("error-message").innerHTML="Please Enter Message"; document.forms["subFrm"]["message"].focus(); return false; } else{ document.getElementById("error-message").innerHTML=""; } }