X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsymbols%2Fsrc%2FRoo_bootstrap_CheckBox.js.html;h=eb55bdf44528ea6157beceb232584dfc2d300b33;hb=55eaa96bc7c2a974413f6ef4c4f60fab80b13320;hp=01151cd0b4d575d11c95f8230b1a8b0e162b0a7b;hpb=3001f1efb6975abb2b30a6fc08bff0b7cc29f59f;p=roojs1 diff --git a/docs/symbols/src/Roo_bootstrap_CheckBox.js.html b/docs/symbols/src/Roo_bootstrap_CheckBox.js.html index 01151cd0b4..eb55bdf445 100644 --- a/docs/symbols/src/Roo_bootstrap_CheckBox.js.html +++ b/docs/symbols/src/Roo_bootstrap_CheckBox.js.html @@ -66,12 +66,22 @@ tag: 'input', id : id, type : this.inputType, - value : this.inputType == 'radio' ? this.inputValue : ((!this.checked) ? this.valueOff : this.inputValue), + value : this.inputValue, cls : 'roo-' + this.inputType, //'form-box', placeholder : this.placeholder || '' }; + if(this.inputType != 'radio'){ + var hidden = { + tag: 'input', + type : 'hidden', + cls : 'roo-hidden-value', + value : this.checked ? this.valueOff : this.inputValue + }; + } + + if (this.weight) { // Validity check? cfg.cls += " " + this.inputType + "-" + this.weight; } @@ -82,10 +92,18 @@ if(this.checked){ input.checked = this.checked; + } + if (this.name) { + input.name = this.name; + + if(this.inputType != 'radio'){ + hidden.name = this.name; + input.name = '_hidden_' + this.name; + } } if (this.size) { @@ -119,6 +137,10 @@ inputblock.cn.push(input); + if(this.inputType != 'radio'){ + inputblock.cn.push(hidden); + } + if (this.after) { inputblock.cn.push({ tag :'span', @@ -188,8 +210,10 @@ cfg.cn.push(boxLabelCfg); } + if(this.inputType != 'radio'){ + cfg.cn.push(hidden); + } - return cfg; }, @@ -201,6 +225,10 @@ { return this.el.select('input.roo-' + this.inputType,true).first(); }, + hiddenEl: function () + { + return this.el.select('input.roo-hidden-value',true).first(); + }, labelEl: function() { @@ -267,7 +295,8 @@ this.inputEl().dom.checked = state; - this.inputEl().dom.value = state ? this.inputValue : this.valueOff; + + this.hiddenEl().dom.value = state ? this.inputValue : this.valueOff; if(suppressEvent !== true){ this.fireEvent('check', this, state); @@ -282,7 +311,7 @@ return this.getGroupValue(); } - return this.inputEl().getValue(); + return this.hiddenEl().dom.value; }, @@ -411,7 +440,7 @@ if(label){ label.markValid(); } - + if(this.inputType == 'radio'){ Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){ e.findParent('.form-group', false, true).removeClass([_this.invalidClass, _this.validClass]); @@ -532,7 +561,6 @@ this.fireEvent("enable", this); return this; } - });