Solved

Limit displayed length of dynamic dropdown list

Posted on 2007-04-06
11
192 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]
Comment Utility
use the SIZE property of the SELECT list

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

Accepted Solution

by:
steelseth12 earned 125 total points
Comment Utility
<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
Comment Utility
i must type slow afterall sorry angelIII.
0
 

Author Comment

by:rguzik
Comment Utility
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
Comment Utility
It should work, please show your code.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 27

Assisted Solution

by:yodercm
yodercm earned 125 total points
Comment Utility
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
Comment Utility
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]
Comment Utility
>it works with size="2"
hmmm. didn't I post that also? :-)
Glad we could help
0
 

Author Comment

by:rguzik
Comment Utility
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]
Comment Utility
>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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
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 look for a specific file type in a local or remote server directory using PHP.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now