468,471 Members | 1,733 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,471 developers. It's quick & easy.

Limiting the number of options shown in a <select> drop down menu.

Please Help Me!!

I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp).

There are about 70 options, and when you click the dropdown button, it
shows about 25 (depending on screen resolution) and then the gives you
a scroll bar to get to the rest.

My question is, can I limit the number of options shown when you click
the drop down button, but still be able to scroll through all the
options. Ideally I'd like to limit it to showning 5 to 10 options.

Quick example of what I want to acheive is to click on your IE Address
Bar's drop down button. Mine shows 14 urls and I can scroll down to
the others.

Any ideas appreciated.. HTML, VBScript, Javascript... what ever works.
:)
Jul 20 '05 #1
3 22546
da************@hotmail.com (Darren) wrote in
news:89**************************@posting.google.c om:
I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp). My question is, can I limit the number of options shown when you click
the drop down button, but still be able to scroll through all the
options.


Have you looked at the size attribute?
http://www.w3.org/TR/html4/interact/...ef-size-SELECT

--
Dave Patton
Canadian Coordinator, the Degree Confluence Project
http://www.confluence.org dpatton at confluence dot org
My website: http://members.shaw.ca/davepatton/
Vancouver/Whistler - host of the 2010 Winter Olympics
Jul 20 '05 #2
Dave Patton <dp*****@remove-for-nospam.confluence.org> wrote in message news:<Xn******************************@24.71.223.1 59>...
da************@hotmail.com (Darren) wrote in
news:89**************************@posting.google.c om:
I've created a typical <form> and a <select> element. The options are
created dynamically from my access database (using asp).

My question is, can I limit the number of options shown when you click
the drop down button, but still be able to scroll through all the
options.


Have you looked at the size attribute?
http://www.w3.org/TR/html4/interact/...ef-size-SELECT


Hi Dave

I tried to use the size attribute as you suggested; if you don't
include it in the <select> tag its default size is 1. I've added it
like this...
<select name="staffmember" size="2"> and it increased the size number
of viewable options making a scroll box with 2 rows. It does allow you
to scroll through the options but removes the drop down list.

This is not quite what I'm after :(

I need to keep the number of viewable options to be 1 row. But when
you click the drop down button you then see 5 (or whatever number) out
of the 70 options. Then in the drop down list be able to scroll
through the rest.

I've looked every high and low and still the best example is the way
IE Address bar works.

Thanks, any and all other suggestions are greatly appreciated :)
Jul 20 '05 #3
da************@hotmail.com (Darren) wrote:
I tried to use the size attribute as you suggested; if you don't
include it in the <select> tag its default size is 1. I've added it
like this...
<select name="staffmember" size="2"> and it increased the size number
of viewable options making a scroll box with 2 rows. It does allow you
to scroll through the options but removes the drop down list.

This is not quite what I'm after :(

I need to keep the number of viewable options to be 1 row. But when
you click the drop down button you then see 5 (or whatever number) out
of the 70 options. Then in the drop down list be able to scroll
through the rest.


Not possible in HTML.

The number of items displayed in the dropdown is a feature of the
browser and/or operating system. It will vary from user to user and is
out of your control.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Greg Scharlemann | last post: by
7 posts views Thread by Hal Vaughan | last post: by
3 posts views Thread by gekoblu | last post: by
3 posts views Thread by Bilal | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by kmladenovski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.