GIF89a
function ValidateForm4(theForm) { var subCat=$("#mycat").val(); if(subCat=="") { alert("Select Category first"); $("#mycat").focus(); return false; } if (!regexp.test(subCat)) { alert("Invalid subcategory"); theForm.subcat.focus(); return false; } if (subCat == "") { alert("Enter category"); theForm.subcat.focus(); return false; } if (subCat.length < 3) { alert("Enter category"); theForm.subcat.focus(); return false; } if (subCat.length > 30) { alert("Enter category"); theForm.subcat.focus(); return false; } return true; }