var i=0;
subfields.each(function() {
if(i in values) {
this.getElementsByTagName('input')[1].value = values[i];
$(this).children('input,textarea').first().val( values[i] );
}
else {
this.getElementsByTagName('input')[1].value = "";
$(this).children('input,textarea').first().val( "" );
i++;
});
-