Solved

Disable Scrollbar in autocomplete box.

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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 dynamically set the form action using jQuery.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now