how can I set the selected item of a search dropdown (select) form field? I tried it with the following jQuery/JavaScript code:
if (equal == 0) {
$('#sj_company').html($('#sj_company').html() + '<option value="' + key + '" selected="selected">' + data[key] + '</option>');
$('.searchdropdown').dropdown('set selected', data[key]);
} else {
$('#sj_company').html($('#sj_company').html() + '<option value="' + key + '">' + data[key] + '</option>');
}
Edit: The base is the semantic ui frontend framework ;-)