I want to fill form inputs with JSON encoded data from ajax. My jQuery code is
$('#event_id').blur(function(){
$.getJSON('../ajax/regattaformAjax.php', fetchOld);
function fetchOld(data){
$.each(data, function(label, value){
$('[#'+label+']',data).val(value);
});
}
});
and the JSON-encoded data from regattaformAjax.php is
{"Address":"1717 88th Dr SE","Chevrons":"Black","City":"Lake Stevens","Class":"IOM","ClubAMYA#":"132"}
There are no errors in the console. Where did I go astray?