Since I'm more versed in php thank in js I'll try to explain what I need from a php perspective. I need to pass to a javascript function an array:
array('fieldname' => 'value', 'fieldname2' => 'value2' ...);
Thne the function would do this
foreach(array as k => v) {
<input name='fieldname' value='value'/>
<input name='fieldname2' value='value2'/>
...
}
I don't know how to do this, I understand that js don't have multidimensional array, so I wonder what is the correct way to do this in javascript?
p.s. I understand that there is a library that make available the php function to js, but I want to learn what is the best practice to do this in pure js.
Thank you very much