function validateContactForm() { var fieldsArray = new Array("name","subject","mailID","phNo","comments"); var msgArray = new Array("Enter the Name","Enter the subject","Enter the mailID","phone","Enter the comments"); var msgFldArray = new Array("name","subject","mailID","phone","comments"); var fldTypeArray = new Array("text","text","email","phone","text"); if(checkFormFields('feedBackForm',fieldsArray,fldTypeArray,msgArray,msgFldArray)) { document.getElementById("submit").disabled=true; contactFormEmail(); // document.getElementById("submit").disabled=false; } return false; } function contactFormEmail() { var email = ""; var fromName = ""; var comments = ""; var subject = ""; var xmlDoc = ""; var statusMsg = ""; var phNo3 =""; var phNo2 = ""; var phNo1 = ""; try { fromName = document.feedBackForm.name.value; } catch(e) {} try { phNo1 = document.feedBackForm.phNo1.value; } catch(e) {} try { phNo2 = document.feedBackForm.phNo2.value; } catch(e) {} try { phNo3 = document.feedBackForm.phNo3.value; } catch(e) {} var phone= phNo1 + phNo2 + phNo3; try { email = document.feedBackForm.mailID.value; } catch(e) {} try { comments = document.feedBackForm.comments.value; } catch(e) {} try { subject = document.feedBackForm.subject.value; } catch(e) {} var url = "sendContactEmail.php"; var qstr = "email="+email+"&comments="+comments+"&subject="+subject+"&phone="+phone+"&fName="+fromName; try { xmlDoc = getXMLDoc(url,qstr); } catch(e){} try { statusMsg = xmlDoc.getElementsByTagName("statusMsg")[0].firstChild.nodeValue; } catch(e) {} if(statusMsg > 0) { window.location.href="contactThanks.php"; } else { window.location.reload(); } }