tags:

views:

40

answers:

3

hi all ,

I have a strange problem with POST data, i have two conditions

I had four input boxes with name

<input name="a[]"><input name="a[]"><input name="a[]"><input name="a[]">

and data is posted by method "&a[]=12&a[]=9&a[]=12&a[]=43".

but when i am using extjs i am hanged if i do

store.load({params:{ 'a[]':12 ,'a[]':9 , 'a[]':12 , 'a[]':43      }});

this only a[]=43 reached to the post data and never to the another end ,

also if i do

store.load({params:{ a[]:12 ,a[]:9 , a[]:12 , a[]:43      }});

this is an error

so please help to clear my concept

A: 

The name property corresponds to the HTTP field names for forms. These need to be unique. The system reads these in order. Thus, only the last one a[]:43 is read in. If you give each of the properties a unique name they will be read in...

e.g. (not tested)

<input name="a1"><input name="steaksauce"><input name="heinz"> <input name="57">

store.load({params:{ "a1" :"asdf", "steaksauce":"325", "heinz":"yummy", "57":"fitty"});

Please refer to The HTTP Forms documentation for more information

It Grunt
hi Grunt , tag names can be repeated but id cannot be repeated Please try an example by your self on your system u will find whats true
Extjs Commander
http://stackoverflow.com/questions/3055931/input-tags-with-arrayPlease see this, also see my answer
Extjs Commander
A: 

Why are you using input boxes with a format like this:

<input name="a[]"><input name="a[]"><input name="a[]"><input name="a[]">

Can you provide the exact code you are using?

Swar
this is my requirement as i have to deal with pre-built script
Extjs Commander
any ways i have already found the solution Please see to it
Extjs Commander
A: 

this really works for the above problem Please solve that problem like this

store.load({params:{ 'a[0]':12 ,'a[1]':9 , 'a[2]':12 , 'a[3]':43      }});
Extjs Commander