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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:29:54+00:00 2026-05-27T22:29:54+00:00

I have 4 jQuery autocomplete textboxes. I need to add some style to one

  • 0

I have 4 jQuery autocomplete textboxes. I need to add some style to one particular autocomplete list.

The ul is added to the body with the class ui-autocomplete. There is no link that would say which ul belongs to which textbox.

So i need to add the style to the UI after the Ajax Success or some option that comes with

$("#srchList").autocomplete(
 source: function (request, response) {
          $.ajax({  .....
                        success: function (d) {
                         },
                    ......
                 });
          },
 open: ....
 select : .....
).data('autocomplete')._renderItem = function (liObj, item) {
    //Position the Autocomplete dropdown. This is not working !!!
    //$(liObj).parent().css({ 'margin-left': '-18px' });

    //Style the dropdown Item. (this works. the li is returned as string to jQuery UI and is added by the jQuery UI to the ul)
    return $("<li class='dropItem'></li>")
          .data("item.autocomplete", item)
          .append($("<a></a>").html(item.label))
          .appendTo(liObj);
};

There are some options like open :, positon: etc. But none of them get the ul-control for me to apply the css style over it.

Please help me to get the reference to the ul for one particular textbox.

DOM Structure: The textbox is somewhere inside the <form>

enter image description here

Thanks in advance.

  • 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-27T22:29:54+00:00Added an answer on May 27, 2026 at 10:29 pm

    “the ul is added to the body by Jquery UI. We cannot control the DOM structure as to where the ul is added. Updating an image of how my DOM is… – Raghav 5 mins ago” – you actually can influence where the placeholder ul is inserted by Jqueryui:

    Use the “appendTo” option when initiating the autocompletes.
    Have two empty divs, one where “standard” uls will be appended, one where you have your special style ul.

    $(".the-standards").autocomplete({ appendTo: "#someStandardDiv" });
    $(".your-special-autocomplete").autocomplete({ appendTo: "#someSpecialDiv" });
    

    and then in your css, you can pre-specify fancyness like

    #someSpecialDiv .ui-autocomplete { border: 1px solid red !important };
    

    of access your special listing from jQuery by:

    $('#someSpecialDiv .ui-autocomplete').css('border', '1px solid red');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two jQuery autocomplete textboxes on a mvc web page. One that returns
I've recently added the JQuery autocomplete plug in and have a textbox that autocompletes
I have some problem with Jquery Autocomplete plugin ( http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ ) I got it
I have just implemented the excellent jQuery UI autocomplete. http://jqueryui.com/demos/autocomplete/ There is a strange
I have a jquery autocomplete textbox. http://docs.jquery.com/UI/Autocomplete#events The spec there shows this: Triggered when
I have a page, which uses jQuery Autocomplete on the second two textboxes (investigator
I need a jquery autocomplete that only does one call to the server then
I have a jQuery Autocomplete field on an ASP.Net Webform and everything has been
I have an jQuery.autocomplete field presenting a limited range of decimal numbers. Ex: var
I have a jquery autocomplete field working fine followed by a date input field.

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.