Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6069965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:52:47+00:00 2026-05-23T09:52:47+00:00

I am using CodeIgniter for my website. On one page I show different vehicles.

  • 0

I am using CodeIgniter for my website. On one page I show different vehicles. The user can browse through all results with pagination.

I also have a few dropdown boxes which the user can use to further filter the results. One dropdown box contains the main category with brands (Mercedes, DAF, …)

The second dropdown box contains vehicle types. For this box I created a JQuery function which updates the contents of the box based on the brand selected in the first box. This does not work anymore when I click on a pagination link to go to the next page. I guess it has something to do with the fact that the function is created in the ready part. Can someone help, please?

JQuery code:

<script type="text/javascript">
function updateTypes(){
    $.ajax({
        type: "POST",
        data: "merk_id=" + $('#selection').val()  + "&voertuig=" + $('#voertuig').val(),
        url: "dropdown",
        success: function(msg){
            if (msg != ''){
                $("#selectionresult").html(msg).show();

            }
        }
    });
}


    $("#selection").change(updateTypes);


    // Update types when entering the second box with the mouse
    $("#selectionresult").mouseenter(updateTypes);

The first box has an id=selection and the second box has an id=selectionresult

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:52:48+00:00Added an answer on May 23, 2026 at 9:52 am

    It sounds like the .html() call wipes out the previously-bound click event handler. Use .live() or .delegate() instead of .click(). Change

    $("#selection").change(updateTypes);
    

    to

    $("#selection").live('change', updateTypes);
    // or
    $('some ancestor of #selection').delegate('#selection', 'change', updateTypes);
    

    Doing this binds the event listener higher up the DOM tree, so the listener won’t get obliterated by the $("#selection").html() call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using CodeIgniter to pass some parameters to my PHP page through $_POST
I am using codeigniter. My products page shows all the products we have and
I am currently building a website in codeigniter that is one page site, basically
I'm re-creating a registration for my website using Codeigniter. On my previous page, I
I am developing a website using Codeigniter that will have different subdomains for different
I made one website xyz.com using php codeigniter framework. This website has modules, so
i want to make rating system for my website using codeigniter and MySQL. Can
I am developing a website using CodeIgniter and PHP. Some of my friends suggest
I'm using CodeIgniter and I got a model that fetches let's say all recipes
I am using codeigniter and its pagination class. It works perfectly and it looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.