I got 4 std class objects i deliver from db through json to javascript like this:
var options_de = <?php echo $data[0]->options_de; ?>;
var options_cz = <?php echo $data[0]->options_cz; ?>;
var options_en = <?php echo $data[0]->options_en; ?>;
var options_pl = <?php echo $data[0]->options_pl; ?>;
EDIT: This is solution:
for(var x=1; x<=Object.keys(options_de).length; x++) {
$('.d_options').append('<input type="text" class="i_options_de" autocomplete="off" value="'+options_de[x]+'" />');
$('.d_options').append('<input type="text" class="i_options_cz" autocomplete="off" value="'+options_cz[x]+'" />');
$('.d_options').append('<input type="text" class="i_options_en" autocomplete="off" value="'+options_en[x]+'" />');
$('.d_options').append('<input type="text" class="i_options_pl" autocomplete="off" value="'+options_pl[x]+'" /><a class="remove">X</a>');
}
All works fine but unfortunetely im getting each loop from beginning to the end before next loop starts and i cant have that. I need this to go like that:
- 1 de 1 cz 1 en 1 pl
- 2 de 2 cz 2 en 2 pl
- and so on and so forth
anyone has idea how to modify it to work the way i need it to? ;)