How To Refresh Coldfusion Bind Select

bind
The above drop down list using cfselect bind to show data. We want user click the button to add some item to the dropdown list. When the user click the button the modal as below is showed :

modal

How to do when user click add, the new item has be entered before listing in drop down menu without refresh the page? Here the solution :

When ajax action submit success you just add this code :

ColdFusion.bindHandlerCache['yourElementID'].call();

For example :

  $.ajax({
    url: 'add_action.cfm',
    type: 'POST',
    data: formData,
    success: function (returndata) {
      $('#myModal').modal('hide');	
        ColdFusion.bindHandlerCache['company_id'].call();
      },
 });

That’s all.

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.