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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:57:14+00:00 2026-05-21T17:57:14+00:00

I’ve just added the jQuery UI combobox to a page. It seems it restricts

  • 0

I’ve just added the jQuery UI combobox to a page. It seems it restricts selections to only those passed in (or present in the select list). What I wanted to do was to have it so that if the user enters a value that isn’t in the select list it sends the data off to the server (on the post) and creates one. I can’t see any options to disable ‘validation’. How would I go about adding this functionality?

–EDIT–

I’ve added the code in to get the autocomplete working with a button appended. However this isn’t working when calling an Ajax method. The Ajax method is correctly returning json (a list of colours) but when I start typing ‘Re’ in the hope it’ll filter down items that contain Red, it doesn’t.

Here’s my code:

var $colInput = $("#Colour").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "/admin/stockitems/colours",
                dataType: "json",
                data: { id: null },
                success: function (data) {
                    var arr = [];
                    $.each(data, function (i, val) {
                        arr.push(val.Title);
                    });
                    response(arr);
                }
            });
        },
        minLength: 0
    }).addClass("ui-widget ui-widget-content ui-corner-left");

    $("<button type='button'>&nbsp;</button>")
        .attr("tabIndex", -1)
        .attr("title", "Show All Items")
        .insertAfter($colInput)
        .button({
            icons: {
                primary: "ui-icon-triangle-1-s"
            },
            text: false
        })
        .removeClass("ui-corner-all")
        .addClass("ui-corner-right ui-button-icon")
        .click(function () {
            // close if already visible                         
            if ($colInput.autocomplete("widget").is(":visible")) {
                $colInput.autocomplete("close");
                return;
            }
            $(this).blur();
            $colInput.autocomplete("search", "");
            $colInput.focus();
        });
  • 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-21T17:57:15+00:00Added an answer on May 21, 2026 at 5:57 pm

    The combobox demo uses an underlying select element as the backing store for the autocomplete widget. I would not recommend this for a form in which you allow the user to input whatever they want.

    However, you can emulate the combobox effect yourself without too much trouble:

    var $input = $("#tags").autocomplete({
        source: availableTags,
        minLength: 0
    }).addClass("ui-widget ui-widget-content ui-corner-left");
    
    $("<button type='button'>&nbsp;</button>")                     
        .attr("tabIndex", -1)                     
        .attr("title", "Show All Items")                     
        .insertAfter($input)                     
        .button({                         
            icons: {                             
                primary: "ui-icon-triangle-1-s"                         
            },                         
            text: false                     
        })                     
        .removeClass("ui-corner-all")                     
        .addClass("ui-corner-right ui-button-icon")                   
        .click(function() {                         
            // close if already visible                         
            if ($input.autocomplete("widget").is(":visible")) {
                 $input.autocomplete( "close" );
                 return;                         
            }                                              
            $(this).blur();                                                 
            $input.autocomplete("search", "" );                         
            $input.focus();                     
        });
    

    Basically, this is the default behavior of the autocomplete widget, plus a button that will drop down all the options.

    This way, the backing field is an input element, and you can take the user’s input upon form submission and add it to the source for next time.

    Here’s a working example: http://jsfiddle.net/andrewwhitaker/CDYBk/1/

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker

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.