function FormState_132709() { formid = '132709'; this.getFragmentValue = getFragmentValue; this.setFragmentValue = setFragmentValue; this.validateAndReturnMessage = validateAndReturnMessage; this.clearFragmentErrors = clearFragmentErrors; this.getFragmentErrors = getFragmentErrors; this.validateInput = validateInput; this.checkConditions = checkConditions; // list of all fragments: this is for evaluating expressions var firstname = new Object(); this['firstname'] = new Object(); this['firstname'].errors = new Object(); this['gx_action_firstname'] = ''; var lastname = new Object(); this['lastname'] = new Object(); this['lastname'].errors = new Object(); this['gx_action_lastname'] = ''; var job_title = new Object(); this['job_title'] = new Object(); this['job_title'].errors = new Object(); this['gx_action_job_title'] = ''; var company = new Object(); this['company'] = new Object(); this['company'].errors = new Object(); this['gx_action_company'] = ''; var email_address = new Object(); this['email_address'] = new Object(); this['email_address'].errors = new Object(); this['gx_action_email_address'] = ''; var tell_me_more_about = new Object(); this['tell_me_more_about'] = new Object(); this['tell_me_more_about'].errors = new Object(); this['gx_action_tell_me_more_about'] = ''; var comments = new Object(); this['comments'] = new Object(); this['comments'].errors = new Object(); this['gx_action_comments'] = ''; var profileid = new Object(); this['profileid'] = new Object(); this['profileid'].errors = new Object(); this['gx_action_profileid'] = ''; Array.prototype.contains = function (element) { for (var i = 0; i < this.length; i++) { if (this[i] == element) { return true; } } return false; } function setPrecondition(identifier, inputidentifier, mode) { var obj = document.getElementById('precondition_' + formid + '_' + inputidentifier); if (typeof obj != 'undefined') { var value = obj.value; var spl = value.split(','); if (mode == 'add') { if (!spl.contains(identifier)) { // add it spl.push(identifier); } } else { if (spl.contains(identifier)) { // remove it removeByElement(spl,identifier); } } obj.value = spl.join(','); } // console.log(inputidentifier + '---' + obj.value); } function removeByElement(arrayName,arrayElement) { for(var i=0; i