In the question asked here, i see that the following code can be used for adding options to SELECT
function getResults(str) {
$.ajax({
url:'suggest.html',
type:'POST',
data: 'q=' + str,
dataType: 'json',
success: function( json ) {
$.each(json, function(i, optionHtml){
$('#myselect').append(optionHtml);
});
}
});
};
Can someone please tell me, what the format of the json should be, on the php server side. Like, how should it be created, so that it is parsed correctly by "$('#myselect').append(optionHtml);" ??