function validateForm(formName,objVar,doc_root){ if(checkEmpty(formName,objVar)){ objCountry = document.getElementById('country'); if(objCountry.value=='Country' || objCountry.value==''){ alert("Please select country"); return false; } var fileName = (document.getElementsByName('imagefile_1_1_item'))[0].value; var dotPos = fileName.lastIndexOf('.'); var ext = (fileName.substr(dotPos)).toLowerCase(); if(ext!='.doc' && ext!='.pdf' && ext!=''){ alert("Please select correct file type [.doc OR .pdf]"); return false; } objSubmit = document.getElementById('submit'); objSubmit.src = doc_root+'images/processing.gif'; objSubmit.disabled = true; return true; }else{ return false; } }