You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in a Rails+jQuery app, building my options for combobox using some json that I grab via ajax. If my field already has an existing value, I can't get that value to be set within the box.
I'm currently trying to add the "selected" attribute when I populate the list of options if it matches the current value:
if (json.value == current_value) {
html = '<option value="'+json.value+'" selected>'+json.text+'</options>';
}
else {
html = '<option value="'+json.value+'">'+json.text+'</options>';
}
$('#field select').data('combobox').refresh();
I'm in a Rails+jQuery app, building my options for combobox using some json that I grab via ajax. If my field already has an existing value, I can't get that value to be set within the box.
I'm currently trying to add the "selected" attribute when I populate the list of options if it matches the current value:
But that's not working. Is this the same as #75 ?
Is there another solution, perhaps passing in the selected value when combobox is initialized?
Thanks in advance!
The text was updated successfully, but these errors were encountered: