// Initialize namespace if (typeof WebGUI == "undefined") { var WebGUI = {}; } if (typeof WebGUI.Form == "undefined") { WebGUI.Form = {}; } /** * This object contains generic form modification functions */ /*********************************************************************************** * @description This method assembles the form label and value pairs and * constructs an encoded string. * @method buildQueryString * @public * @static * @param {string || object} form id or name attribute, or form object. * @param {object} object containing array of form elements to exclude. { id:[], name:[], classNames:[], type:[] } * @return {string} string of the HTML form field name and value pairs. */ WebGUI.Form.buildQueryString = function ( formId, excludes ) { var _isInArray = function ( value, array) { if(!array || !value) return 0; if(typeof array != 'object') return 0; for(var i = 0; i < array.length; i++) { if(array[i] == value) return 1; } return 0; }; var oForm = (document.getElementById(formId) || document.forms[formId]); var oElement, oName, oValue, oDisabled; var sFormData = ""; if(!excludes) { excludes = {}; } // Iterate over the form elements collection to construct the label-value pairs. for (var i=0; i+ : 0|1 to save * the state of the toggled checkboxes. You can use this to set what the * first run of toggleAllCheckboxesInForm will do. */ WebGUI.Form.toggleAllCheckboxesState = {};