bselect
bselect copied to clipboard
Update select after insert new options
Hi, Is there a way to update the select after dynamically inserting new options?
// I create a new option and insert it in the select
jQuery("#jform_user_id").append(jQuery("<option>").text(data.user.name+' '+data.user.surname).attr("value", data.user.id));
// Set the option as selected
jQuery("#jform_user_id").val(data.user.id);
// Now I should update the select with the new option, how can I do?
jQuery("#jform_user_id").bselect("updateOptions") ???
Thank you