Hi all,
in my app i've a getJson call returning a map, one element of which is an
array named TAGLIE with say 10 elements; my object is named "il modello", so
i've:
var taglie = ilModello.TAGLIE;
in my form i've a table, with 2 td's
<table>...
<tr>
<td id="leTaglie">...</td>
...
<tr>
<td id="leQuantita">...</td>
in every of these td's i want to append some input , 1 for every array
element
for(var i = 0; i < taglie.length; i++){
$("td#leTaglie").append("<input type='Text' class='taglie' disabled>");
$("td#leQuantita").append("<input type='Text' class='qta' maxlength='3'
value='0' onchange='sumQta()'>");
}
then i want to assign a value to these fields:
$("input.taglie").each(function(i){this.value = i});
$("input.qta").each(function(i){this.value = i});
but i have the ten fields appended to td#leTaglie, numbered from 0 to 9, but
i have the other ten fields appended to td#leQuantita numbered from 1 to 10.
how is this possible?
regards
salvatore