Solved

Disable Scrollbar in autocomplete box.

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
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 dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

734 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