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

  • SEARCH
  • Home
  • 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 6960923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:27:50+00:00 2026-05-27T15:27:50+00:00

i am using chosen prototype. i want to update second select box based on

  • 0

i am using chosen prototype.
i want to update second select box based on first select box. how to do this?
i can able to fire onchange event but i am not able to update the second select box based on onchange event in first select box.

<select class="chzn-select" id="one">
    <option>one</option>
    <option>two</option>
    <option>three</option>
</select>
<select class="chzn-select" id="two">
    </select>


$$('#one').each(function(select) {
    new Chosen(select);
})
.invoke('observe', 'change', function() {
     alert(document.getElementById("one").value);

    //update the second select here


});
$$('#two').each(function(select) {
    new Chosen(select);
})
.invoke('observe', 'change', function() {
    alert(document.getElementById("two").value);
});
  • 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-27T15:27:51+00:00Added an answer on May 27, 2026 at 3:27 pm

    Here is example update code based on DOM:

    // get value of #one
    var v = document.getElementById("one").value;
    
    // get select #two
    var sel = document.getElementById("two");
    
    // remove all options
    while (sel.childNodes.length > 0) {
        sel.removeChild(sel.childNodes[0]);
    }
    
    // add 2 new options
    var o1 = document.createElement('option');
    o1.innerHTML = v + '-one';
    sel.appendChild(o1);
    
    var o2 = document.createElement('option');
    o2.innerHTML = v + '-two';
    sel.appendChild(o2);
    
    // update chosen
    Event.fire($("two"), "liszt:updated");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using chosen prototype for select box. Now i want to fire onchange
I have one select box with options and I am using jQuery Chosen on
VB6 classes have no parameterized constructors. What solution have you chosen for this? Using
I am using two dateTimePicker's, and lets say I've chosen 11-11-2011 on the first,
I'm using this code to display several forms on my page based on the
[UPDATE] Chosen approach is below, as a response to this question Hi, I' ve
I'm using Chosen special input box for the Project Type input box on my
I'm using the chosen.js plugin http://harvesthq.github.com/chosen/ with jQuery to allow the user to select
I am using Chosen http://harvesthq.github.com/chosen/ to populate a select list. When a user selects
I'm using this select style http://www.8stream.com/scripts/styleSelect/ I have the problem that the right select,

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.