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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:10:42+00:00 2026-06-12T01:10:42+00:00

I have functionality setup to execute whenever a select element changes its value. Instead

  • 0

I have functionality setup to execute whenever a select element changes its value. Instead of using the normal onchange event, it executes every 300ms and only calls the handler if it detects a changed value. I’m using prototype’s Form.Element.Observer, if this means anything to you.

Now, in Firefox, when the user hovers over the option and the timed value check function fires, the handler is called because the browser says that the value has changed. What I would like to do is be able to detect when the option has actually been selected by the user instead of simply hovered over. I realize in the Prototype documentation, they explicitly note this bug (or feature, depending how you look at it) but I would like to be able to normalize the behavior.

In a way, this is somewhat similar to a question I’ve seen on StackOverflow before ( Detect if an HTML select element is expanded (without manually tracking state) ) but I was hoping someone out there would be able to tell me how to do this for only a specific select element and when it’s closed instead of expanded.

To get a better idea of what I mean, check out http://jsfiddle.net/KxQd6/ , mess with the select element and check out the console logs.

  • 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-12T01:10:43+00:00Added an answer on June 12, 2026 at 1:10 am

    Here is an example showing how to control SELECT element changes through the different stages you mentioned:

    (user, dom-load, and js update)

    This code utilizes event.simulate which provides a cross browser way of firing/simulating events.


    CODE (fiddle)

    document.observe('dom:loaded', function() {
        var select = $('box_1'),
            button_1 = $('change_via_ajax'), 
            button_2 = $('change_via_script'), 
            results = $('results');
    
        // create observer on our select
        select.observe('change', function(e) {
            var d = new Date()
                t = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
            results.insert(new Element('div')
                   .update(t + ' - Change was fired, value is now [' + this.value + ']'));
        });
    
        button_1.observe('click', function() {
            new Ajax.Request('/echo/json/', {
                onComplete: function(j) {
                    select.options[Math.round(Math.random() * 2)].selected = true;
                    select.simulate('change');
                }
            });
        });
    
        button_2.observe('click', function() {
            select.options[0].selected = true;
            select.simulate('change');
        });
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have some functionality working but its really ugly and I know
I am trying to setup editing functionality using MVC3 and entity framework 4. I
I have an HTML table setup in a visualforce page with some functionality that
So I have the following setup: a VB6 Application using a .NET dll on
I have some functionality withing a script file, setup.fsx I would like to test
I want to have functionality on my application that lets a user check off
I have a functionality in jquery-mobile in which I want to redirect to another
I have some functionality that I need in all my classes which derive from
I have a functionality where a user is given file to download. It works
I have common functionality that I need to access from all screens of my

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.