function LTrim( value ) { var re = /\s*((\S+\s*)*)/; return value.replace(re, "$1"); } // Removes ending whitespaces function RTrim( value ) { var re = /((\s*\S+)*)\s*/; return value.replace(re, "$1"); } // Removes leading and ending whitespaces function trim( value ) { return LTrim(RTrim(value)); } function submit1() { if(document.f4.EnquiryType.value=="0") { alert("Select Enquiry Type."); document.f4.EnquiryType.focus(); return false; } if(document.f4.CompanyName.value=="") { alert("Enter Company Name."); document.f4.CompanyName.focus(); return false; } if(trim(document.f4.CompanyName.value)=="") { alert("Please enter the Company Name"); document.f4.CompanyName.focus(); return false; } else { var str=document.f4.CompanyName.value; var str1=document.f4.CompanyName.value.length; var iChars = "*|\"<>[]{}`\';()@&$#%0123456789"; for (var i = 0; i []{}`\';()@&$#%0123456789"; for (var i = 0; i []{}`\';()@&$#%"; for (var i = 0; i []{}`\';()@&$#%0123456789"; for (var i = 0; i []{}`\';()@&$#%"; for (var i = 0; i 15) { alert("Please Enter Phone no. not more than 15 digits"); document.f4.phone.value=""; document.f4.phone.focus(); return false; } if(document.f4.ContactMethod.value=="0") { alert("Select Contact Method."); document.f4.ContactMethod.focus(); return false; } if(document.f4.ContactTime.value=="0") { alert("Select Contact Time."); document.f4.ContactTime.focus(); return false; } if(document.f4.Comments.value=="") { alert("Enter Comments."); document.f4.Comments.focus(); return false; } if(trim(document.f4.Comments.value)=="") { alert("Please enter the Comments"); document.f4.Comments.focus(); return false; } if(document.f4.EnquiryType.options[document.f4.EnquiryType.selectedIndex].value=='Service call') { if(document.f4.Machine.value=="0") { alert("Select Machine TYPE."); document.f4.Machine.focus(); return false; } /*if(document.f4.ModelNo.value=="") { alert("Enter ModelNo."); document.f4.ModelNo.focus(); return false; } if(trim(document.f4.ModelNo.value)=="") { alert("Please enter the ModelNo"); document.f4.ModelNo.focus(); return false; } else { var str=document.f4.ModelNo.value; var str1=document.f4.ModelNo.value.length; var iChars = "*|\"<>[]{}`\';()@&$#%"; for (var i = 0; i