Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
Javascript change event never called

I have this order question related top javascript. In the aspx page I have this SubmissionMaintenance.init that call this return classes in javascript getRecord and saveRecord. I wanted to add a $("#ddlCompany").change event and no matter when I add it it will never get called.

aspx Page

<script type="text/javascript">
    $(document).ready(function () {
        SubmissionMaintenance.init();
    });

JS Page

return {
    init: function () {
        getRecord();
        
        saveRecord();
    }
}


var getRecord = function () {

    html += "<select class='form-control select2-multiple' multiple='multiple' id='ddlCompany' name='ddlCompany' >";
    
    $("#submission").html(html);

}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You'll need to add the change event listener to a parent element because the element you want to listen to is added after the dom has loaded.

Try this:

$( "#submission" ).on( "change", "#ddlCompany", function() {
  console.log( '#ddlCompany change' );
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!