472,780 Members | 1,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 23054
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Greg Scharlemann | last post by:
I am attempting to populate a drop down menu based on the selection of a different drop down menu. However, it is not working correctly, I cannot figure out for the life of me what exactly happens...
7
by: Hal Vaughan | last post by:
I have a sample script from a book ("Beginning JavaScript" by Paul Wilton) that removes or adds a choice to a <SELECT> element. The <FORM> is form1 and the <SELECT> is theDay. The example uses...
3
by: gekoblu | last post by:
Hi!, I want to fix via javascript the combo width to a fix value. I'd like to implement a kind of ALT / TITLE function to show the entire option when the text is longer than the combo width......
3
by: Bilal | last post by:
Hi, I've been looking all over the net for a way to increase the size of a drop down menu without any success. Does anyone perhaps have a way to display 11-15 items on a menu without having...
6
by: Omar | last post by:
Hi, In a JSP I have the next: .... codigo = "<select name='" + nombre + "'>\n<option selected value='default'>Escoge</option><option value='todos'>Todos</option>"; if (miRS != null) while...
1
by: mcapacci | last post by:
I would like to force the flow of the scrolling of the options listed in a drop down menu, <select>, from top to bottom without allowing bottom up scroll to appear; furthermore I need also to...
1
by: thesti | last post by:
hello, i need to validate birthday using javascript. the validation is that for example user couldn't choose the date 29, 30 and 31 if she has chosen February as the month before and the year % 4...
1
by: vinpkl | last post by:
hi all i have two dynamic drop downs of dealer id and category id which work properly with window.location var dealerid; function getList(xyz) {...
2
by: Mihai Popescu | last post by:
Is there a way to select lets say max selected options from a <select> tag... for example I have a select with 150 options... but I want to select maximum 30... I've tried with js onclick and...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.