5 Replies Latest reply on Sep 28, 2013 9:55 AM by iccsi

    refresh cfquery

    iccsi Level 1

      I have followign code to have my dropdown list, it seems that it does not refresh the list until re start the application.

      I have a create new button beside the list to let user create new records if it does not exsit.

      The create new record works, but the list does not refresh until next time to restart application.

      I would like to know is it possible to refresh cfquery on the select control when user add new record.


      Your help and information is great appreciated,






      <select name="Mylst" id="Mylst" >


         <cfoutput query="MySP">

               <option value="#MySP.MyID#"

                <cfif (isDefined("form.MyID") AND form.MyID EQ MySP.MyID) 






        • 1. Re: refresh cfquery
          AnimeXCom Level 1

          It sounds like your have caching turned on in your query.  Can you please post your query code for the query "MySP"? You can either re-trigger the query to refresh it after you modify/create a record in that table or remove the caching setting from the query.

          • 2. Re: refresh cfquery
            iccsi Level 1

            <cfstoredproc procedure="Mystoredprocedure" datasource="mydb">

            <cfprocresult name="MySP" resultset="1">



            I use MS SQL stored procedure and cfstoredproc for my select list data source.

            does caching setting at server side or client side?

            I think that I need refresh drop down list query,


            Thanks again for helping,





            • 3. Re: refresh cfquery
              AnimeXCom Level 1

              If there is no query caching turned on then maybe the issue is your page flow.  Unless you have caching turn on the database server somehow via the stored procedure?

              • 4. Re: refresh cfquery
                iccsi Level 1

                Thanks for the information and help,


                I do not turn on caching from stored procedure.


                Thanks again,






                • 5. Re: refresh cfquery
                  iccsi Level 1

                  jQuery("#MySelect").change(function() {



                                                url: "Myserver.cfm?MyID=" + jQuery("#MySelect").val()

                                                , type: "get"

                                                , success: function(result) {






                  I think I know what is the problem.

                  This drop down box is a child of the form and it created at run time by jQuery on change even of one drop down.

                  I think that I need re create the child form since it created by jQuery using html result.


                  Thanks again for your help and information,