This question is the opposite of Collect several input fields and insert into a single field with jquery
I have 4 input textfields, and a single textfield that should extract its value and distribute them into each separate input using index.
I am expecting a reverse process (from the previous question) to get default value from distributor to be distributed/ populated into distributed textfield. Each value is pipe delimited.
<input type="text" value="Data 1 | Null | Data 3 | Data 4" class="distributor">
<input type="text" class="distributed">
<input type="text" class="distributed">
<input type="text" class="distributed">
<input type="text" class="distributed">
The distributor has an array-like value string: Data 1 | Null | Data 3 | Data 4
Null is accepted from original process, simply to maintain the process of explode and implode by PHP.
So input#1 will recieve Data 1, etc in an indexed manner, hopefully, because the order is fixed and using name attributes seems redundant.
Any hint is very much appreciated. Thanks
An example with jsfiddle: http://jsfiddle.net/bouillard/NWUxq/
can be extend for null values.