Solved

Limit displayed length of dynamic dropdown list

Posted on 2007-04-06
11
195 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
  • 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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:yodercm
ID: 18867802
It should work, please show your code.
0
 
LVL 27

Assisted Solution

by:yodercm
yodercm 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:yodercm
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

828 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