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

Related

Reactjs: Add days to input field type="time"

I want to build a time-selector with the format "dd:hh:mm:ss". So far I have following code:
<DetailBar title="Deadline:" type="time" step="2" innerRef={deadlineInput} id="deadlineInput" valid={orderValid}/>
I set step="2" so seconds are shown.
Detailbar class internally maps the input values onto an input field and returns it, which looks like this:
What I am trying to achieve now, is creating a fourth "field" ("--:") representing days, selectable up to a number of 365. Sadly there is not that much documentation about using type="time". Can this even be achieved using an input field like mine maybe by overriding or setting the attributes right or do I have to code myself a field like this? Any solutions are welcomed.

Autocomplete ="off" , Autocomplete ="Nope" , Autocomplete ="false" Not Working on chrome

I'm using angularjs + HTML5 , and i need to be able to disable all my input fields autocomplete , i have tried adding autocomplete=false,nope,off, random number , field name
And none worked!
I have tried adding angularjs directive buts still having the same result
I did a temporary workaround adding an empty hidden input field , that did work , but i have a big project with a huge amount of inputs so i cannot do this on every single field
Any help?
I do not know the answer, but I recommend you, to go and tell the Chromium developers that you have a use case, where unwanted autocomplete="off" should not be obeyed.
See their questionnaire at:
https://bugs.chromium.org/p/chromium/issues/detail?id=587466

angularjs adding "input-txtgray" only to one field

In my angularjs component.ts file I have code that looks like
this.inputmy_input_name[id] = 'input-txtgray';
what this does is that it adds input-txtgray class to form element my_input_name
but the problem is there are 2 or more form elements with the same name and I need to change only one (the one next to the element that triggered the call), I suppose thats what the id is supposed to do but doesn't.
I am new to Angular and I am not sure if this is something that is standard to Angular or is this something that is in the code somewhere?
Edit: The elements are autogenerated using other code and I can't change the elements without extensively editing the rest of the code and right now I do not wish to do so.
Any help highly appreciated.
Thanks
Rather than doing this way, you can use ngClass.
Read abt it here: angular.io/api/common/NgClass
<some-element [ngClass]="{'input-txtgray': true}">
</some-element>
In the place of true, you can put a boolean variable(initially false) and trigger it true on API call

How to post the things which we want successfully?

I'm new to reactjs, i wanted to post the message through the fetch method successfully, as i 've raised the query but the solution didn't worked out for me and given negative votes for the query. I'm writing my problem because i have gone through similar links and i have tried but not getting expected output. Sometimes it's working fine and the next day it is showing error in res(json) line. And want to clear the message after posting but when i use this link solution "How to clear the input after posting the data through fetch and making the code execute successful" sometimes the message is getting disappear and sometimes message is not getting posted. Anyone help me in this? thanks in advance.
You need to use the value from the state inside input to be able to clear it:
<input
className="sendMessage"
onChange={this.handleChange}
name="body"
value={this.state.body} // Add input value
/>

Angular ng-form group errors

I have one problem with form and ng-form.
Here is the sample https://jsfiddle.net/HB7LU/12182/
What I would like to do is display group messages.
eg. If I have 3 items and any are invalid then show the error message outside of ng-form.
I don't want to repeat every error message under input. If 3 inputs with name 'number' is invalid, I want to display only one message.
Does anyone have any ideas how to achieve this?
I figure it out.
https://jsfiddle.net/HB7LU/12189/
it works with angular 1.3+
but if someone have better solution I will like to see it.
Thanks.

Resources