Solved

Limit displayed length of dynamic dropdown list

Posted on 2007-04-06
11
198 Views
Last Modified: 2010-08-05
Is there a way to control how many lines display in a dynamically built dropdown list. For example, a list of states and the dropdown should include all states but only display 1 or 2 lines and allow scrolling thru the list?  Thanks...
0
Comment
Question by:rguzik
[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
  • 3
  • 3
  • 3
  • +1
11 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18867746
use the SIZE property of the SELECT list

<SELECT .... SIZE=2 ...>... </SELECT>
0
 
LVL 20

Accepted Solution

by:
steelseth12 earned 125 total points
ID: 18867748
<select size="4">
<option>1</option>
<option>21</option>
<option>3</option>
<option>4</option>
</select>

set size to howmany lines you want to show
0
 
LVL 20

Expert Comment

by:steelseth12
ID: 18867753
i must type slow afterall sorry angelIII.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rguzik
ID: 18867795
I tried that before posting... it doesn't work...  
When the list "drops down" it occupies 65 lines :-(
0
 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 18867802
It should work, please show your code.
0
 
LVL 27

Assisted Solution

by:Cornelia Yoder
Cornelia Yoder earned 125 total points
ID: 18867824
Wait, do you want to show 4 lines at the start, or have only 4 of the 65 lines show WHEN the dropdown button is pressed?

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

Author Comment

by:rguzik
ID: 18867854
Thanks steelseth12 and yodercm. I was just being to stingy... it works with size="2" but not size="1". I can live with that :-)
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18867859
>it works with size="2"
hmmm. didn't I post that also? :-)
Glad we could help
0
 

Author Comment

by:rguzik
ID: 18867884
Sorry angelIII... you are so right! If I can find the way to do so I will award points to you as well :-)   Thanks...
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18867902
>If I can find the way to do so I will award points to you as well
no problem, does not hurt me.
simply look better next time(s) :-)
0
 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 18867911
rquzik, you can email the EE admin and ask them to adjust the points.  Explain and they'll fix it for you.  AngelIII does deserve some of the points.
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

623 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