Is there a way to refresh a query driven CFSELECT with JQuery?
Here is my scenario:
I have a CFSELECT that is populated using cfquery
<cfselect name="descriptionDD1" id="descriptionDD1" query="customDescriptions" value="description" queryPosition="above">
<option value="add_new">ADD NEW</option>
</cfselect>
If a user clicks the "ADD NEW" option, a MODAL is popped where they can add to this very list of data in the database that the CFSELECT is pulling from. Here is the AJAX post:
<script>
$(function(){
//Add a new note to a link
$("#addDescriptionForm").submit(function(){
// prevent native form submission here
$.ajax({
type: "POST",
data: $('#addDescriptionForm').serialize(),
url: "actionpages/add_descriptions_modal.cfm",
success: function() {
$("#addDescriptionResponse").append( "Successfully added description." );
}
});
return false;
});
});
</script>
I have that part working, however after a user adds the new data and closes out the MODAL window, you have to refresh the whole page to see the updated CFSELECT list.
This is not desirable because if you refresh the whole page, then the user will loose the information that they have inputted into other form elements.
So is there a way I can tell just the CFSELECT element to update itself to retrieve the updated list of data?
Thank a bunch. -Brian