<p>Last time <a href="https://stackoverflow.com/questions/169506/get-form-input-fields-with-jquery">I asked about the reverse process</a>, and got some very efficient answers. I'm aiming for least lines of code here. I have a form of fields and an associative array in the {fieldname:data} format, I want to populate a corresponding form with it.</p>

If your form elements have their ID set to the fieldname:
```
```
$.each(myAssocArry, function(i,val) { $('#'+i).val(val); });
```
```