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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:16:37+00:00 2026-06-16T02:16:37+00:00

I have a change event bound to a select tag. The first option in

  • 0

I have a change event bound to a select tag. The first option in the select tag is disabled because I am using it as the default text for the menu. If the user clicks on the select tag, hovers over an option without selecting it, and then clicks outside of the select menu twice the change event is being fired. How can I prevent this change event from being fired.

The HTML

<select id="select">
    <option disabled="disabled" selected="selected">Title</option>
    <optgroup label="things">
        <option>cars</option>
        <option>boats</option>
        <option>world</option>
    </optgroup>
</select>

The jQuery

$('#hide').click(function(){
    $('#select').hide();
});
$('#show').click(function(){
    $('#select').show();
});
$('#select').change(function(){
    alert($(this).val());
});

The code is just a sample of what my problem is. I added the buttons because in my real code I am hiding the select menu when the user clicks outside of it.

Here is a fiddle with the above code.

EDIT

After looking at comments it looks to be a firefox specific issue as it works fine in Internet Explorer, Chorme, and Safari.

  • 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-16T02:16:38+00:00Added an answer on June 16, 2026 at 2:16 am

    You could always associate some data on the select with the current value and validate that it actually changed.

    $('#hide').click(function(){
        $('#select').hide();
    });
    $('#show').click(function(){
        $('#select').show();
    });
    $('#select').data('currVal', 'Title');
    $('#select').change(function(){
        if($(this).val() != $(this).data('currVal') {
            // this is actual value change
            alert($(this).val());
            $(this).data('currVal', $(this).val());
        }
    });
    

    I have updated the original fiddle with solution:

    http://jsfiddle.net/TPpD6/4/

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

Sidebar

Related Questions

I have capture change event on drop down select. This drop down field is
I have two pages, on the first page after an event happens I change
I have a web page which loads select boxes dynamically using jQuery Load Event
I have an element: <input type="file" id="fileUpload" size="100" name="fileUpload"/> A change event is bound
I have this: function change( event, file ) { console.log( filename, file ); //It
I'm using Excel VBA and have a worksheet_change event like so: Private Sub Worksheet_Change(ByVal
I have 2 questions on kendo combobox change event. On change event I want
I have a custom jQuery plugin which binds a change event to a form
Is it possible to see which files have been changed whenever an change-event is
I have RowDatabound event where I want to change column names like this: Protected

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.