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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:30:12+00:00 2026-05-14T18:30:12+00:00

I am using this jQuery UI combobox autocomplete control out of the box off

  • 0

I am using this jQuery UI combobox autocomplete control out of the box off the jQuery UI website:

My issue is that I have multiple comboboxes on a page, and I want them to have different widths for each one.

I can change the width for ALL of them by adding this CSS:

 .ui-autocomplete-input
 {
     width: 300px;
 }

but I can’t figure out a way to change the width on just one of them.

  • 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-14T18:30:13+00:00Added an answer on May 14, 2026 at 6:30 pm

    A simple

    $('.ui-autocomplete-input').css('width','300px')
    

    works (I tried it on the linked page with Firebug) to change the first one on the page.

    You can do something like:

    $($('.ui-autocomplete-input')[N]).css('width','300px') #N is the nth box on the page
    

    To change the Nth one.

    To find a specific one by a characteristic, you could do it in many ways.

    Find it by the first “option” (in this example “asp”):

    $('.ui-autocomplete-input').map(function(){if ($(this).parent().children()[1].options[0].text == 'asp'){ $(this).css('width','300px'); return false;} })
    

    Find it by its “label”:

    $('.ui-autocomplete-input').map(function(){if ($($(this).parent().children()[0]).text() == "Your preferred programming language: "){ $(this).css('width','300px'); return false;}})
    

    etc…

    I’ll update if you have an idea of how you want to find your combobox.

    EDIT FOR COMMENT

    oo, that makes it even easier. From the example source you linked to, the HTML is already wrapped in a div:

    <div class="ui-widget" id="uniqueID">
        <label>Your preferred programming language: </label>
        <select>
            <option value="a">asp</option>
            <option value="c">c</option>
            <option value="cpp">c++</option>
            <option value="cf">coldfusion</option>
            <option value="g">groovy</option>
            <option value="h">haskell</option>
            <option value="j">java</option>
            <option value="js">javascript</option>
            <option value="p1">perl</option>
            <option value="p2">php</option>
            <option value="p3">python</option>
            <option value="r">ruby</option>
            <option value="s">scala</option>
        </select>
    </div>
    

    I would give that div a unique id then:

    $('#uniqueID > input.ui-autocomplete-input').css('width', '300px')
    

    That selects child elements of your div that are inputs with a class of “ui-autocomplete-input”.

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

Sidebar

Related Questions

I have this strange issue with my web app. You see, I'm using jQuery
I'm using JQuery and Prototype in this web application that I'm developing. I'm looking
I've got this textBox which triggers off an ajax request using jQuery: <asp:TextBox ID=postcodeTextBox
I have this version of jQuery-autocomplete: jQuery Autocomplete Mod , It's cool with me
I'm using the nifty 'combobox' variant of jQuery UI Autocomplete - see here: http://jqueryui.com/demos/autocomplete/#combobox
I am using this jquery ui autocomplete but i need to grab the data
New to javascript/jquery and having a hard time with using this or $(this) to
I need to change an element's ID using jQuery. Apparently these don't work: jQuery(this).prev(li).attr(id)=newid
I can't tell if this is a result of the jQuery I'm using, but
I am currently testing this in Mozilla FireFox 3.0.5 using FireBug 1.3.0 with jQuery

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.