function disableEnterKey() { $('input').bind("keyup keypress", function(e) { var code = e.keyCode || e.which; if (code == 13) { e.preventDefault(); return false; } // END if }); } // END function disableEnterKey() function setSelectOptions(fid, urlJSON, bKeyValueFlag) { $.ajax({ method: "POST", url: urlJSON, data: { }, dataType: "json", success: function(getJSON) { getSelectMenuKeyValueJSON(fid, getJSON, bKeyValueFlag, ""); }, failure: function() { alert('Error in retrieving Perosonal Property information. Please try again later.'); } }); return false; } // END function setSelectOptions() function getFormLabelsJS(fid, label) { strFormElements = ""; strFormElements += "\n"; return strFormElements; } // END getFormLabelsJS() function getFormElementsJS(fid, cssClass, jsOnChange, bReadOnly) { var strFormElements = ""; strFormElements += "- Please select -\n"; } // END if strReturn += "\n"; return strReturn; } // END function getSelectMenuArrayJS() function changeTaxAcctNum() { var valTaxAcctNum = $("#txtTaxAcctNum").val(); valTaxAcctNum = formatTaxAcctNum(valTaxAcctNum); if ( (valTaxAcctNum != "") || (valTaxAcctNum) ) { getPPAccountsInfo(valTaxAcctNum); } // END if return false; } // END function changeTaxAcctNum() // function getPPAccountsInfo() function formatTaxAcctNum(tanid) { var valThis = tanid; var iNumDigits = 6; var strLeadChar = "0"; var strTaxNumLead = "P"; var strThisPre = valThis.slice(0, 1); var strThisDigits = valThis.slice(1); var iNumCharThis = strThisDigits.length; var strResult = ""; switch (true) { case /^[pP]{1}/.test(strThisPre): strThisPre = strThisPre.toUpperCase(); strResult = padLeadingChar(strThisDigits, iNumDigits, strLeadChar); strResult = strThisPre+strResult; break; case /^\d{1}/.test(strThisPre): strThisDigits = strThisPre+strThisDigits; strResult = padLeadingChar(strThisDigits, iNumDigits, strLeadChar); strResult = strTaxNumLead+strResult; break; default: strResult = ""; } // END switch $("#txtTaxAcctNum").val(strResult); return strResult; } // END function formatTaxAcctNum() function changeSignatureChk(){ if($("#chkSignatureChk").prop("checked")) { $("#txtSignatureBox").prop("readonly", false); $("#txtSignatureBox").focus(); } else { $("#txtSignatureBox").prop("readonly", true); $("#txtSignatureBox").val(""); $("#chkSignatureChk").focus(); } // END if return false; } // END function changeSignatureChk() function getSelectMenuKeyValueJSON(slctName, arrJSON, bKeyValue, keySelected) { var iNumItems = arrJSON.length; var slctMenuHTML = ""; var iX = 0; $("#"+slctName).empty(); $("#"+slctName).append($('', { value: "", text: "- Please select -" })); $.each(arrJSON, function(key, value) { iX++; switch (bKeyValue) { case "F1": $("#"+slctName).append($('', { value: value[0], text: value[0]+"-"+value[1] })); break; case "F2": $("#"+slctName).append($('', { value: value[0], text: value[0] })); break; case "F3": $("#"+slctName).append($('', { value: value[0], text: value[1] })); break; default: $("#"+slctName).append($('', { value: key, text: value[1] })); } // END switch if (bKeyValue == 1) { } else if (bKeyValue == 2) { } else { } // END if }); if (keySelected != "") { $('#'+slctName).find('option[value='+keySelected+']').prop("selected",true); } // END if return false; } // END function getSelectMenuKeyValueJSON() function getSelectMenuJSON(slctName, arrJSON, bKeyValue, bFreeForm, strAddendum) { var iNumItems = arrJSON.length; var slctMenuHTML = ""; var iX = 0; $("#"+slctName).empty(); $("#"+slctName).append($('', { value: "", text: "- Please select -" })); $.each(arrJSON, function(key, value) { iX++; if (iX == iNumItems) { tmpVal = value[1]+" "+strAddendum; } else { tmpVal = value[1]; } // END if if (bKeyValue) { $("#"+slctName).append($('', { value: value[1], text: tmpVal })); } else { $("#"+slctName).append($('', { value: value[0], text: tmpVal })); } // END if }); if (bFreeForm) { $("#"+slctName).append($('', { value: "FF", text: "- Custom Description -" })); } // END if return false; } // END function getSelectMenuJSON() function checkCheckbox(chkFID, bChecked) { if (chkFID != "") { $("#"+chkFID).prop("checked", bChecked); } // END if return false; } // END function checkCheckbox() function updateNumCreatedRows(fid, iVal) { var iTemp = parseInt($("#"+fid).val()); iTemp = (iTemp + iVal); $("#"+fid).val(iTemp); return false; } // END function updateNumCreatedRows()