Solved

Disable Scrollbar in autocomplete box.

Posted on 2008-10-23
5
963 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 50 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

695 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