Solved

Limit displayed length of dynamic dropdown list

Posted on 2007-04-06
11
194 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 142

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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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 142

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 142

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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