Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I make the ajax run?

When I add the ajax it only runs once.

I try that when I enter a letter in the search engine or change a select field, it sends me the new search to display it on the screen.

formMenu is a form containing a select and an imput text.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

 $('#formMenu').on('keyup change',function() {    
                 
         $.ajax(
                      {
                        url: '/calendar',
                        success: function( data ) {
                          $('body').html(data);
                        }
                      }
                    );
      });

>Solution :

You can Try using the below.

$(document).on('keyup change', '#formMenu', function() {
  // Your Ajax Call here
})
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading