473,394 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Controlling HTML SELECT vertical scroll bars

Hi,

I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing. The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box. I'm starting to
think that this isn't possible.

I've tried the following with no luck:

- Setting the height attribute on the select element
- Setting a style height for the select attribute
- Modifying the same through Javascript
- Setting the style overflow-y to scroll
- Setting the size of the select element

At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS. That the magic number of IE is 30 entries before
the vertical scroll bar shows up.

That's where I'm at right now. Can anyone help shed some light on this?

Sep 18 '07 #1
4 22115
Matthew Cox wrote:
The problem I'm trying to solve is that the designer would like
to limit the total number of entires shown when you click on
the drop-down arrow of a select box. I'm starting to think that
this isn't possible.
You're right.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 19 '07 #2
Matthew Cox wrote:
Hi,

I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing. The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box. I'm starting to
think that this isn't possible.

I've tried the following with no luck:

- Setting the height attribute on the select element
- Setting a style height for the select attribute
- Modifying the same through Javascript
- Setting the style overflow-y to scroll
- Setting the size of the select element

At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS. That the magic number of IE is 30 entries before
the vertical scroll bar shows up.

That's where I'm at right now. Can anyone help shed some light on this?
You could change the dropdown to a non-dropdown select list of the size
you want by adding a size="X" attribute to the select element (where X
is the number of entries you want to show). Then you could show and
hide that list using javascript on a button, and load the currently
selected item into another element. Basically faking the whole
interaction of the dropdown list.

But you shouldn't. You have already put far too much work into this,
and really it should be the designer's job to design around this
limitation (rather than risking the breakage of functionality for some
people just so your designer can have his way).

Jeremy
Sep 19 '07 #3
Thanks all for confirming.

Sep 19 '07 #4
Hi Mathew,
I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing.
I agree that it should be straight-forward but, as you've discovered, sadly
it isn't.

FWIW, Here are a couple of examples of LOV size control that may or may not
help with what you're trying to do: -

http://manson.vistech.net/t3$examples/demo_client_web.html

To see the example you will need:-

1) Javascript enabled
2) Java Applets enabled
3) Can't be behind a Firewall that forbids all unknown outgoing connections
(otherwise open-up 5255)
4) Must be running SUN's JRE 1.4.2_13 or later (1.6 is advised)
5) Must be running Internet Explorer (6 or later) or Firefox (Haven't tested
other browsers)

All things being equal you should then be prompted (via Java modal dialogue
box) for:-

Username: TIER3_DEMO
Password: QUEUE

Now enter an asterix "*" for the Queue Name and you will see the
List-of-values appear with all the available queues on the Deathrow cluster.
(This is one of those predictive text thingies that RobG says are humbug.
"There should be a SUBMIT button in there God damn it!" :-) I have had to
set the minimum size of the Select List to two (even if there is only one
entry) this is because IE (at least) is crap and uses a seperate window for
<selectlists. (Does it still do this with IE7?)

Now click on the "Get Job Info" button and the list of available Jobs is
returned. (Again, I grow the list to four entries then the scroll-bar
diminishes and the "Jobs Found" field clicks over in real-time.)
Unfortunately, setting "selectedIndex" disabled/enable and the timing of
such is *critically* important for a pleasant sscreen appearance :-(

Anyway, here is just one way of doing it. (Try clicking on the header row to
see RobG's great idea for improving performance when tearing down select
lists!) Drill down into detail by clicking on an option in the select list?)

Cheers Richard Maher

"Matthew Cox" <Ma***********@gmail.comwrote in message
news:11**********************@50g2000hsm.googlegro ups.com...
Hi,

I've been searching the net all day today trying to figure out how one
would accomplish what I originally thought would be a fairly straight
forward and simple thing. The problem I'm trying to solve is that the
designer would like to limit the total number of entires shown when
you click on the drop-down arrow of a select box. I'm starting to
think that this isn't possible.

I've tried the following with no luck:

- Setting the height attribute on the select element
- Setting a style height for the select attribute
- Modifying the same through Javascript
- Setting the style overflow-y to scroll
- Setting the size of the select element

At some point in my browsing someone claimed that the vertical scroll
bars are controlled by the OS/Browser and there are no ways to change
this using JS or CSS. That the magic number of IE is 30 entries before
the vertical scroll bar shows up.

That's where I'm at right now. Can anyone help shed some light on this?

Sep 20 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Rwj Cherry CS2000 | last post by:
is there any way to disable or lock vertical scroll bars on a browser window? im a newbie and i just don't want them to appear on my screen. sometimes they appear on IE but not on mozilla. any...
0
by: Sachin | last post by:
How to match the look and feel of vertical scroll bar with the inbuilt vertical scroll bars of some controls like PrintPreviewControl, Rich Text box , etc. Their scroll bars look blue where the...
2
by: Brett | last post by:
I'm using the web browser object: SHDocVw.dll. I do this in form Load() Me.AxWebBrowser1.Navigate("http://www.abc.com/") Sometimes when a website loads, it causes horizontal or vertical scroll...
1
by: Dica | last post by:
i've got an image too large to fit inside my picture control. how do i get horizontal and vertical scroll bars?
1
by: Robert G | last post by:
I'm using VB .net 2003. I have a grid where everything is working fine except when after the grid is filled with records (by setting the data source to a data view), both the horizontal and...
0
by: jojobar | last post by:
We are using the ASP:Menu control (horizontal) for site navigation. The menu is contained by a table with css styles that allows us to give the illusion of a menu bar that runs the entire width of...
0
by: MrNobody | last post by:
I made a custom user control which is supposed to be my own little simple gui data table and I extend from UserControl and set it's autoscroll property to true yet as I draw outside the vertical...
2
by: axapta | last post by:
Hi Group, I seem to be getting horizontal and vertical scroll bars in my datagrid. Where are the settings/what can I do so that the datagrid is fixed and does not grow with the data horizontally...
4
by: simulationguy | last post by:
Any of you run into this, i have tried setting the properties of the form to vertical scroll bars only and both neither seems to work. The horizontal scroll bar works fine but its a long form and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.