Vineesh Kalarickal Vineesh Kalarickal - 4 years ago 155
Ajax Question

Re load Select Option Values - PHP JQuery

I have a bootstrap pop-up form to add kingdom name it will appear when we select Add New option from the Kingdom list, I would like to show the newly added value in the list just after closing the popup window. My current code is given below. But It's not working. Please help.

enter image description here

enter image description here

Answer Source

That's how you append an option to select tag

//...
$('#kingdom_nameerr').html('Saved successfully');
$('#yourSelectIDonPage').append('<option value="'+someOptionID+'">'+optionSelected+'</option>');
//...
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download