Solved

Disable Scrollbar in autocomplete box.

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
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 …

830 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