?
Solved

Disable Scrollbar in autocomplete box.

Posted on 2008-10-23
5
Medium Priority
?
967 Views
Last Modified: 2013-11-10
Hi,
I am developing a site in Symfony. I have a autocomplete box whose contents ate taken from a databse. If there are many recors the autocomplete box shows a scrollbar. which is fine. But If there are 1 or 2 records then also a scroll bar is shown which doesnt look nice. Please help me disable the scrollbar in autocomplete box.

Thanks
</php echo input_auto_complete_tag('txtFriends', '',
				   'default/getContacts',
array('autocomplete' => 'off','size'=>'20','class' => $txtCss." nobdrfld" , 'onkeyup'=> 'KeyPress(event)','style'=>"overflow:hidden;"),
array('use_style'    => true, 'before_update_element' => 'KeyPress', 'after_update_element'  => "getSelectionId")

Open in new window

0
Comment
Question by:abhishekoza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 13

Accepted Solution

by:
Xyptilon2 earned 200 total points
ID: 22820048
You've to find a way to set the CSS property "overflow" of the parent div (the container) to "auto", this will only add scrollbars when needed. Probably at the moment it is set to: scroll

There are 4 possible values for "overflow"

overflow: visible Adjusts height and width of the div so that the content can fit
overflow: hidden content is clipped
overflow: scroll Add scrollbars (even when not necessary)
overflow: auto Only add scrollbars when needed

I hope this is helpful to you. Goodluck!
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I spent hours debugging an issue in a Rails project where ActiveRecord was causing MySQL errors trying to create a User object of a class at the top level of a Single Table Inheritance model structure.  It turns out `.create` behaves differ…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question