not able to form post data for passing in extjs
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
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
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?
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 }});
精彩评论