Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 04:10 PM
Darren
Guest
 
Posts: n/a
Default 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.
:)
  #2  
Old July 20th, 2005, 04:10 PM
Dave Patton
Guest
 
Posts: n/a
Default Re: Limiting the number of options shown in a <select> drop down menu.

darrenstahlhut@hotmail.com (Darren) wrote in
news:898d00a0.0307092156.49bf4737@posting.google.c om:
[color=blue]
> I've created a typical <form> and a <select> element. The options are
> created dynamically from my access database (using asp).[/color]
[color=blue]
> 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.[/color]

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
  #3  
Old July 20th, 2005, 04:10 PM
Darren
Guest
 
Posts: n/a
Default Re: Limiting the number of options shown in a <select> drop down menu.

Dave Patton <dpatton@remove-for-nospam.confluence.org> wrote in message news:<Xns93B3EC1CBD3F5mrzaphoddirectca@24.71.223.1 59>...[color=blue]
> darrenstahlhut@hotmail.com (Darren) wrote in
> news:898d00a0.0307092156.49bf4737@posting.google.c om:
>[color=green]
> > I've created a typical <form> and a <select> element. The options are
> > created dynamically from my access database (using asp).[/color]
>[color=green]
> > 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.[/color]
>
> Have you looked at the size attribute?
> http://www.w3.org/TR/html4/interact/...ef-size-SELECT[/color]

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 :)
  #4  
Old July 20th, 2005, 04:10 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: Limiting the number of options shown in a <select> drop down menu.

darrenstahlhut@hotmail.com (Darren) wrote:
[color=blue]
>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.[/color]

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 <steve@pugh.net> <http://steve.pugh.net/>
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles