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 8119297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:45:48+00:00 2026-06-06T04:45:48+00:00

I have 2 drop-down menus (select1 and select2) and 1 input text (rate). When

  • 0

I have 2 drop-down menus (select1 and select2) and 1 input text (rate). When selecting a value in select1, it changes in select2. When I select a value in select2, the value appears in the input text. Now what I want is to change the input text to change when the select2 is changed by the select1 trigger. But that doesn’t work. I tried change, blur… but it didn’t help.

Any idea?

$('#select1').change( function() { 
    $.post("includes/functions.php", {select1: ""+$(this).val()+""},
      function(data){
        var objet = JSON.parse(data);       
        ...
        $("#select2").val(objet.select2value); //That works!
      }
}

and then:

$('#select2').bind('keyup blur change focus click', function(){
  $.post("includes/functions.php", {
    rate: ""+$(this).val()+"" }, function(data){
       var objet = JSON.parse(data);
       /* That works when I change select2 directly in the drop-down;
          not when select2 changed by changing select1 */
       document.form.rate.value = objet.rate;  
  });
});
  • 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-06-06T04:45:49+00:00Added an answer on June 6, 2026 at 4:45 am

    How about refactoring the logic outside of the second handler, and invoking it on both events:

    $('#select1').change( function() { 
        $.post("includes/functions.php", {select1: ""+$(this).val()+""},
          function(data){
            var objet = JSON.parse(data);       
            ...
            $("#select2").val(objet.select2value);
            updateRate();
          }
    }
    
    $('#select2').change( function(){
      updateRate();
    });
    
    function updateRate() {
        $.post("includes/functions.php", {
            rate: ""+ $('#select2').val() +"" }, function(data){
               var objet = JSON.parse(data);
               document.form.rate.value = objet.rate;  
          });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form section with dynamic clone of select drop down menus. The
I have a drop down menu made with Jquery. Right now, if you hover
I need to have a drop-down menu that allows you to select a year
I have a select drop-down that selects a theme for the current page the
I have created 2 drop down menus, from and to, these include times starting
I have two drop down menus, one of which I am trying to replace
I have a drop-down menu in my page, it's something like this: <select id=my_dropdown
I have a drop down menu of mobile brands. When a user selects a
I have a drop down menu in an ASPX page along the lines of:
We have a drop-down menu of volumes in our UI, and I'd like to

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.