I have a select which allows the user to select multiple option. Also on the same page is a form that will allow the user to add new keywords which will appear in the select.
My javascript sends an ajax request to a php script which either returns a success or error message which then gets added to the dom.
The ajax part of the script looks like this
$.post(
metadataAction,
{
dateOfUpdate:dateOfUpdateVal,
metadataStandardName:metadataStandardNameVal,
metadataLanguage:metadataLanguageVal
},
function(responseText) {
$('body').append(responseText);
},
"html"
);
I only want to repopulate the options when a new keyword has been successfully added.
Does anyone have any suggestions on the best way to achieve this?
Thanks for any help.