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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:30:39+00:00 2026-05-25T15:30:39+00:00

Business Requirement: Form to upload a document and assign attributes to the document that

  • 0

Business Requirement:
Form to upload a document and assign attributes to the document that are sourced from an external database. There are 10 form fields and as the user fills in values on the form, the other fields are filtered in real time. I.e. If they select “United States” for country, the state / province field only allows US states.

UX Challenge:
Many of these fields start off with literally millions of possible values so I used jQuery autocomplete for them. As the fields are filtered the number of possible options drop to a number that would be better serviced by a drop-down list.

Question:
Is there a way to dynamically change a jQuery autocomplete field to a dropdown box once the number of options drop below a certain number? I looked at the jQuery autocomplete option but I don’t want to fill a combobox with 1 million+ records even if the user won’t see them all.

  • 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-25T15:30:40+00:00Added an answer on May 25, 2026 at 3:30 pm

    I solved the issue for a UI / UX perspective. I have a background function that lets me know the number of options available for each field. With that information I programmatically change the minlength and delay option. I also bind / unbind a function for the focus event and style it (thanks @Interstellar_Coder) appropriately. This gives the user the immediate response associated with a dropdownlist.

    Below is simple version of what I’m doing. I’m using button click events to mimic what I’m doing programmatically in my actual application.

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
        <link href="CSS/smoothness/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
        <style>
            ul.ui-autocomplete
            {
              height: 100px; 
              overflow: auto; 
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        script type="text/javascript">
            $(function () {
                var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
                $("#tags").autocomplete({
                    source: availableTags,
                    minLength: 1
                });
            });
        </script>
    
            <script type="text/javascript">
                function acdisplay() {
                    $("#tags").autocomplete("option", "minLength", 1);
                    $("#tags").autocomplete("option", "delay", 300);
                    $('#tags').unbind('focus');
                }
    
                function ddldisplay() {
                    $("#tags").autocomplete("option", "minLength", 0);
                    $("#tags").autocomplete("option", "delay", 0);
                    $("#tags").bind('focus', function(){
                        $(this).autocomplete("search", this.value);
                    });
                }
            </script>
            <div class="demo">
                <div class="ui-widget">
                    <label for="tags">Tags: </label>
                    <input id="tags" />
                </div>
                <input type="button" id="acDisplay" value="AutoComplete" onclick="acdisplay()" />
                <input type="button" id="ddlDisplay" value="DropDownList" onclick="ddldisplay()" />
            </div>
        </form>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a business requirement that when the user clicks a series of checkboxes
I have a business requirement that calls for an end user to be able
I have a business requirement that for message boxes, the user cannot press the
I have a SharePoint list with Content Approval enabled. The business requirement is that
I am writing a standard database-backed business application. Assume that I work with bank
The business requirement says that the PDF cannot be printed. I looked up the
I have a business requirement to enforce a check box on a HTML form
I have this requirement for my business. We have a swing desktop application that
I have a business requirement to search through a database table where one of
What business cases are there for using Markov chains? I've seen the sort of

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.