View Full Version : Radio field name with []

19 Sep 2010, 5:39 AM
Hi, my fields in form have a pattern name like formName[%s], for all fields they worked, but now I have a radio field and that same pattern doesn't work.

I got thet error: <span role="presentation" class="objectBox objectBox-text ">Error parsing selector, parsing failed at "]"

Checking the radio source javascript I checked that error is in this line:

Radio.js, line 44

var els = this.getCheckEl().select('input[name=' + this.el.dom.name + ']');
Using firebug I executed this code:

var abc = 'pesquisa[situacao]';
Ext.getCmp('situacao1').getCheckEl().select("input[name='"+ abc +"']");
and worked for me.

My answer is if is that correct ? And if yes, what can I do to that change be reflected in ext-all.js, ext-base.js or whatever ? Or Are there other easy way to use name fields with [] ?

extjs version 3.2.1

19 Sep 2010, 7:20 AM
what do you want to do ? check radio component ? set value ?

19 Sep 2010, 8:06 AM
I want define pesquisa[situacao] to a radio name, just it.

xtype: 'radiogroup',
id: 'situacao',
style: 'padding: 10px',
items: [
{xtype: 'label', text: 'Situação UCs', anchor:'-15'},
{boxLabel: 'Situacao 1', id: 'situacao1', name: 'pesquisa[situacao]', inputValue: 1},
{boxLabel: 'Situacao 2', id: 'situacao2', name: 'pesquisa[situacao]', inputValue: 2},
{boxLabel: 'Situacao 3', id: 'situacao3', name: 'pesquisa[situacao]', inputValue: 3}