Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Update select after insert new options #35

Open
map1975 opened this issue Feb 22, 2018 · 0 comments
Open

Update select after insert new options #35

map1975 opened this issue Feb 22, 2018 · 0 comments

Comments

@map1975
Copy link

map1975 commented Feb 22, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant