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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:45:27+00:00 2026-06-01T22:45:27+00:00

I have a handler associated with a <select> input’s change event using jQuery: $(‘#myList’).change(function

  • 0

I have a handler associated with a <select> input’s change event using jQuery:

$('#myList').change(function () {
   //...
});

When the user Tabs to the input and begins typing (without clicking to open the dropdown list), different browsers behave differently.

  • In Firefox, the change event won’t fire until the user either presses Enter or Tab, or in some other way changes focus away from the select list.
  • In IE and Chrome, the change event is fired the moment the user types something that causes the item in the select list to change.

Because my change function performs an AJAX request, I would prefer to avoid having my function do anything while the user is typing or using the arrow keys to select a choice. However, I still want the change event to fire if the user selects a particular dropdown element with the mouse, or if the user hits the enter key. In other words, I’d like IE and Chrome to behave like Firefox.

Is there any (ideally simple) way to get the behavior I’m looking for?

  • 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-01T22:45:28+00:00Added an answer on June 1, 2026 at 10:45 pm

    EDITED:

    This should handle all of your requirements – http://jsfiddle.net/yfQ3V/4/

    HTML:

    <select data-value="one">
        <option>one</option>
        <option>two</option>
        <option>three</option>
    </select>
    <span></span>
    

    JS:

    var $select = $('select');
    var $span = $('span');
    
    var onChange = function () {
        setText();
    };
    
    var onKeyDown = function () {
        $select.off('change');
        var keyCode = e.keyCode || e.which;
    
        if(keyCode == 13 || keyCode == 9) {
            $select.on('change', onChange).change(); 
        }
    };
    
    var onBlur = function () {
        if($select.val() != $select.data('value')) {
            setText();
        }
    };
    
    var setText = function () {
        var val = $select.val();
        $select.data('value', val);
        $span.text(val + ' - ' + new Date());   
    };
    
    $select.on('change', onChange)
           .on('keydown', onKeyDown)
           .on('blur', onBlur);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an event handler that needs to determine a type and execute code
I have an event handler that will remove an element from a list of
I currently have a jQuery function that replaces an image when clicked. For instance:
I have a DataGridView and a handler for the EditingControlShowing event which is used
I have a handler and I have to send responses to different activities for
I have a handler and a runnable, Handler has a loop that runs from
I have a Handler class that looks like this: class Handler{ public $group; public
We have a requirment which requires to have an Handler that is extended from
In my APP. Need to use Lazy Loading, so I have to handler the
I have a message handler, which consumes from a JMS queue and that sends

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.