function validateMandatoryFields(thisForm, action) { flag = true; thisArray = new Array(); thisArray[0] = new Array(thisForm.compName, "Company Name"); thisArray[1] = new Array(thisForm.compAdd, "Address"); thisArray[2] = new Array(thisForm.compCountryOfReg, "Country of Registration"); thisArray[3] = new Array(thisForm.compEmail, "Company Email"); thisArray[4] = new Array(thisForm.compContactPerson, "Contact Person"); thisArray[5] = new Array(thisForm.userId, "User ID"); thisArray[6] = new Array(thisForm.userName, "User Name"); thisArray[7] = new Array(thisForm.userEmail, "User Email"); if (action == 'update') { thisArray[8] = new Array(thisForm.compCode, "Company Code"); thisArray[9] = new Array(thisForm.password, "Password"); } flag = isAllNotEmpty(thisArray); return flag; } function validateAddForm(thisForm, action) { document.requestRegForm.compOtherMarket.disabled = false; var b = validateMandatoryFields(thisForm, action); if (b == false) { return false; } var c = isEmail(thisForm.compEmail); if (c == false) { return false; } var d = isEmail(thisForm.userEmail); if (d == false) { return false; } var e = checkMarket(thisForm); if (e == false) { return false; } } function checkMarket(thisForm) { if (document.requestRegForm.compMarket.selectedIndex == 0) { document.requestRegForm.compOtherMarket.disabled = false; } else { document.requestRegForm.compOtherMarket.value = ""; document.requestRegForm.compOtherMarket.disabled = true; } } function checkTypeOfApp(thisForm) { flag = mustSelect(thisForm.compyTypeOfApp, "Type Of Application"); return flag; } function checkMarket(thisForm) { if (document.requestRegForm.compMarket.selectedIndex <= 0 && document.requestRegForm.compOtherMarket.value == "") { alert(errorsEitherOneMarketMustBeEntered); document.requestRegForm.compMarket.focus(); return false; } else if (document.requestRegForm.compMarket.selectedIndex > 0 && document.requestRegForm.compOtherMarket.value != "") { alert(errorsEitherOneMarketMustBeEntered); document.requestRegForm.compMarket.focus(); return false; } else { return true; } } function validateRejectForm(thisForm) { var delFlag = confirmReject(); if (delFlag == false) { return false; } else { document.requestRegForm.reject.value = true; } } function validateDeleteAllRejectedForm() { var delFlag = confirmDeleteAllRejectedApp(); if (delFlag == false) { return false; } else { document.requestRegForm.deleteAllRejected.value = true; } } function validateDeleteForm(thisForm) { if (document.requestRegForm.deleteAllRejected.value != "true") { var flag = isMinimumCheck(thisForm.delFlag, 1); if (flag == false) { return false; } else { var delFlag = confirmDelete(); if (delFlag == false) { return false; } else { return true; } } } } function validateUpdateForm(thisForm, action) { var myValue = true; thisForm.redirect.value = false; if (document.requestRegForm.reject.value != "true") { var a = checkTypeOfApp(thisForm); if (a == false) { return false; } var b = validateMandatoryFields(thisForm, action); if (b == false) { return false; } var c = isEmail(thisForm.compEmail); if (c == false) { return false; } var d = isEmail(thisForm.userEmail); if (d == false) { return false; } if (thisForm.compOtherMarket.value != "") { if (confirm("This market does not exist in the system. \n Do you want to create this market ?")) { thisForm.redirect.value = true; return true; } else { alert("Approval can only be procceeded until the market is created"); return false; } } } } function validateEditProfileForm(thisForm, action) { flag = true; thisArray = new Array(); thisArray[0] = new Array(thisForm.userEmail, "User Email"); flag = isAllNotEmpty(thisArray); return flag; } function checkType(thisForm) { document.forms[0].action="requestReg_add.do"; document.forms[0].submit(); }