/**************************************************************************** * Compiere (c) Jorg Janke - All rights reseverd * $Id: wstore.js,v 1.5 2006/05/23 22:39:03 mdeaelfweald Exp $ * * Web Store Scripts ***************************************************************************/ var mandatory = "Enter mandatory:"; /** * Is field empty ? * Returns true if field is empty */ function isEmpty (value) { if (value == null) return true; if (value == "") return true; for (var i = 0; i < value.length; i++) { var c = value.charAt(i); if ((c != ' ' && c != '\n' && c != '\t')) return false; } return true; } function checkCreditCard(field) { window.alert(field.name + "=" + field.value); return true; } function checkExpDate(field) { window.alert(field.name + "=" + field.value); return true; } function checkABA (field) { window.alert(field.name + "=" + field.value); return true; } function checkBAcct (field) { window.alert(field.name + "=" + field.value); return true; } function checkChknum (field) { window.alert(field.name + "=" + field.value); return true; } function checkDL (field) { window.alert(field.name + "=" + field.value); return true; } function checkField (field) { window.alert(field.name + "=" + field.value); return true; } /** * Test mandatory fields for lookup */ function checkLookup (field) { window.alert (field); var f = field.form; window.alert (f); if (!isEmpty(f.EMAIL.value) && !isEmpty(f.password.value)) return true; var msg = mandatory; if (isEmpty(f.EMAIL.value)) mandatory += "\n - " + f.EMAIL.title; if (isEmpty(f.password.value)) mandatory += "\n - " + f.password.title; window.alert(mandatory); return false; } var statusInfo = ''; /**************************************************************************** * Check form * - onSubmit="submitForm(this, new Array ('Name','..'));" */ function checkForm (formObj, requiredFields) { statusInfo += 'checkForm:' + formObj.name + '[' + requiredFields.length + ']'; if (formObj.nodeName == 'FORM') { if (formObj.Submit) { formObj.Submit.disabled=true; statusInfo += '(' + formObj.Submit.name + ')'; } } else { formObj = formObj.form; if (formObj == null | formObj.nodeName != 'FORM') { alert ('invalid submitter'); return false; } statusInfo += '->' + formObj.name; } window.status=statusInfo; var alertMsg = ""; // check required fields if (requiredFields) { for (i=0; i height) menu.style.height = height - (menu.offsetHeight - height) + "px"; if(content.offsetHeight != height) content.style.height=height+"px"; // hack to ensure that padding, border, et al are taken into account if(content.offsetHeight > height) content.style.height = height - (content.offsetHeight - height) + "px"; if(vendor.offsetHeight != height) vendor.style.height = height+"px"; // hack to ensure that padding, border, et al are taken into account if(vendor.offsetHeight > height) vendor.style.height = height - (vendor.offsetHeight - height) + "px"; if(main.offsetHeight != height) main.style.height = height+"px"; // hack to ensure that padding, border, et al are taken into account if(main.offsetHeight > height) main.style.height = height - (main.offsetHeight - height) + "px"; } addOnLoadListener(resizeContent); function updateSelect(ajax, xmlTagName, selectId) { // alert("updateSelect("+xmlTagName+","+selectId+"): " + ajax.request.responseText); var xml = ajax.request.responseXML; var error = xml.getElementsByTagName("error")[0]; if(error) { AJAX.timeoutStatus(error.textContent, 3000); return; } var xmlOptions = xml.getElementsByTagName(xmlTagName)[0]; if(!xmlOptions) { AJAX.timeoutStatus("Unable to read response", 3000); return; } // first we remove existing entries var htmlSelect = document.getElementById(selectId); while(htmlSelect.options.length > 0) { htmlSelect.removeChild(htmlSelect.options[0]); } for(var i=0; i * AL * AK * OR * */ var params = new Array(); params['cmd']='regions'; params['country']=countryId; //params['selected']=regionId; var loader = new AJAX.AjaxLoader("locationServlet", changeCountryCallback, null, "GET", params); } function changeCountryCallback() { updateSelect(this, "regions", "ID_C_Region_ID"); }