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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:47:10+00:00 2026-06-17T21:47:10+00:00

http://www.bulgaria-web-developers.com/projects/javascript/selectbox/ Is there any keypress event, so that user can jump to particular option?

  • 0

http://www.bulgaria-web-developers.com/projects/javascript/selectbox/

Is there any “keypress” event, so that user can jump to particular option? like we have country field and user wants to move to UK, then he need to scroll for finding UK in the list.

  • 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-17T21:47:11+00:00Added an answer on June 17, 2026 at 9:47 pm

    based on The Suresh Atta solution I’ve created the following jquery extension to implement a solution

    /*** EXTEND SELECT BOX TO HAVE KeyUp feature *********/
    jQuery.fn.KeyUpSelectBox = function (options)
    {
    var myHandler = this;
    
    this.init = function ()
    {
        var sb = $(this).selectbox(options);
        var sbSelector = sb.attr('sb');
    
        $("#sbHolder_" + sbSelector).on('keyup', function (e)
        {
            var currentOptionText = $("#sbSelector_" + sbSelector).text().toLowerI();
            var keyText = String.fromCharCode(e.keyCode).toLowerI();
    
            var selectOptions = myHandler.find('option');
            var firstIndexWithLetter = -1;
            var bSet = false;
            var moveToNext = false;
            var bFoundOption = false;
    
            if (currentOptionText.substring(0, 1) == keyText)
            {
                moveToNext = true;
            }
    
            for (var i = 0; i < selectOptions.length; i++)
            {
                var optionText = $(selectOptions[i]).text().toLowerI();
                //console.log(optionText + ': ' + optionText.substring(0, 1));
                if (optionText.substring(0, 1) == keyText)
                {
                    if (moveToNext)
                    {
                        if (firstIndexWithLetter == -1) { firstIndexWithLetter = i; }
    
                        if (bFoundOption)
                        {
                            sb.selectbox("change", $(selectOptions[i]).attr('value'), $(selectOptions[i]).html());
                            sb.val($(selectOptions[i]).attr('value'));
                            bSet = true;
                            break;
                        }
    
                        if (optionText == currentOptionText)
                        {
                            bFoundOption = true;
                        }
                    }
                    else
                    {
                        sb.selectbox("change", $(selectOptions[i]).attr('value'), $(selectOptions[i]).html());
                        sb.val($(selectOptions[i]).attr('value'));
                        break;
                    }
                }
            }
    
            if (moveToNext && !bSet && (firstIndexWithLetter != -1))
            {
                sb.selectbox("change", $(selectOptions[firstIndexWithLetter]).attr('value'), $(selectOptions[firstIndexWithLetter]).html());
                sb.val($(selectOptions[firstIndexWithLetter]).attr('value'));
            }
        });
    }
    
    myHandler.init();
    
    return myHandler;
    }
    

    This extension uses a method named toLowerI that is a string prototype:

    var patternLetters = /[öäüÖÄÜáàâéèêúùûóòôÁÀÂÉÈÊÚÙÛÓÒÔßãÃõÕçÇñÑ]/g;
    var patternDateDmy = /^(?:\D+)?(\d{1,2})\.(\d{1,2})\.(\d{2,4})$/;
    var lookupLetters = {
    "ä": "a", "ö": "o", "ü": "u",
    "Ä": "A", "Ö": "O", "Ü": "U",
    "á": "a", "à": "a", "â": "a",
    "é": "e", "è": "e", "ê": "e",
    "ú": "u", "ù": "u", "û": "u",
    "ó": "o", "ò": "o", "ô": "o",
    "Á": "A", "À": "A", "Â": "A",
    "É": "E", "È": "E", "Ê": "E",
    "Ú": "U", "Ù": "U", "Û": "U",
    "Ó": "O", "Ò": "O", "Ô": "O",
    "ß": "s", "ã": "a", "Ã": "A",
    "õ": "o", "Õ": "O", "ç": "c",
    "Ç": "C", "ñ": "n", "Ñ": "N"
    };
    
    var letterTranslator = function (match)
    {
        return lookupLetters[match] || match;
    }
    
    String.prototype.toLowerI = function ()
    {
        return this.toLowerCase().replace(patternLetters, letterTranslator);
    };
    

    To use it, instead of calling .selectbox() call .KeyUpSelectBox()

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

Sidebar

Related Questions

I am using http://www.bulgaria-web-developers.com/projects/javascript/selectbox/ to change a select box. Here is a example: http://jsfiddle.net/ukkpower/bczrc/1/
http://www.malsup.com/jquery/corner/ Is there any real disadvantage (like SEO) to creating the rounded corners pixel
http://www.bloomberg.com/markets/ has several figures that I would like to display on my html page.
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=759 >> read http://www.informit.com/guides/content.aspx?g=dotnet&s eqNum=759 connecting to: www.informit.com ** User Error: HTTP forwarding error:
http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html Just go through the above link. there is an example sample code for
http://www.beltal.com/ Thanks for any information!
http://www.escapingaspinningroom.com/photos/photo/193 is a web page where I have the comment iFrame on. Litteraly, the
http://www.microsoft.com/windowsxp/using/accessibility/characterrepeatrate.mspx - There's an option in Windows for setting repeat delay. It means the
http://www.e-fluential.com/offline/ Screen grab: I can't get the div that the blue words blah blah
http://www.nicholaslawson.com ... if you click on any of the nav buttons on the side

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.