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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:50:14+00:00 2026-05-14T02:50:14+00:00

I am using a dropdown to allow the user to sort search results. These

  • 0

I am using a dropdown to allow the user to sort search results. These results in a table but not all of the sortable criteria are represented by columns. The columns can be sorted by either clicking on the column header or using a ‘Sort By’ dropdown. The user can reverse the sort by clicking on the sorted columns header. I am trying to duplicate this functionality in the drop down but can’t get it to work in IE7/IE8.

The following is the existing code that works in both IE and Firefox. It changes the sorted column but not the sort direction.

$("#sortSelect").change(function() {
    //change sort
});

This is what I am trying to change it to and it works in Firefox. It changes the sorted column and if the sorted columns is already selected it will change the sort direction.

$("#sortSelect option").click(function() {
    //change sort
});

I was hoping someone would know of a way to trigger the option.click event or know of a good workaround.

  • 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-14T02:50:14+00:00Added an answer on May 14, 2026 at 2:50 am

    To reiterate what T.J. Crowder said in the comments, this is an awkward change that you’re making to a user interface. That being said, it’s possible to distinguish between clicking on the select element and clicking on an option element if the select doesn’t have the multiple attribute set. Try out the following code in Internet Explorer:

    $(document).ready(function ()
    {
      $("#sortSelect").click(function (event) {
        if (event.offsetY > this.offsetHeight)
          $(this.options[this.selectedIndex]).click();
      });
      $("#sortSelect option").click(function (event)
      {
        alert('clicked option '+this.parentNode.selectedIndex);
      });
    });
    

    It works because when you click on an option element, the click event fires on the select element. By detecting that you’ve clicked outside the bounds of the select element checking event.offsetY > this.offsetHeight, you can use jQuery to trigger the click event of the currently selected option element.

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

Sidebar

Related Questions

I m using a dropdown to display Location field of a table. I want
I am using a dropdown to populate a textbox. But if preferred value is
I am using model forms in Django to allow the user to enter in
I need a user interface that allows users to sort a table according to
I'm trying to implement chained filter dropdown using just javascript - jquery. The solution
I'm running into a character encoding issue when I load a dropdown using jQuery
I built a Jquery dropdown menu using this tutorial . It works across browsers
How do I get the selected value from a dropdown list using JavaScript? <form>
I'm using an ASP.NET dropdown. I want to set the selected element using an
I am using jquery to create a custom dropdown with the code below. I

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.