We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Forcing number of lines displayed in pull-down menu?

Dyrewolf
Dyrewolf asked
on
Medium Priority
169 Views
Last Modified: 2012-05-04
Does anybody know if there is a way to force the browser to display a certain number of options in a select pull-down menu? For instance, if there is a select input with 21 options, and you only want 7 visible at a time, and scrolling to the others, is there an HTML tag that can do that?
Comment
Watch Question

Commented:
I don't understand exactly what you want to do, but you could try this:
<SELECT ... SIZE="7">

Martin

Commented:
no, SIZE will make a list box with 7 options shown... not a drop-down box.

Commented:
Ooh, now I understand what you meant...
That's not possible. :-(
At least not according to the HTML 4.0 spec. (http://www.w3.org/TR/REC-html40/)

Of course it's possible that Netscape/Microsoft has added some special attribute, but I don't think they have.

Martin
All,

I think that you can do it using CSS in IE.  You can control most of the form elements using CSS from colour and font to width so there might be a way to control list box size, I'll check.

Trevor.


Author

Commented:
Trevor -

That would be great if you could find out. This is a project for work I told them I would look into, and they probably wouldn't be cool that at least everybody with Netscape/IE 3.0+ could handle, and back to 2.0 if possible.

Thanks for the help
Adam
Dyrewolf,

I have searched the entire Microsoft reference and CSS guide and there does not appear to be anyway to do this.  There was a property called overflow which was to define the height of an object and then have scrollbars applied if the object exceeded that height.  However it applied to textareas and not to SELECT objects.

I have in an attempt to find a solution e-mailed the problem to Microsoft's Web Men (as they like to be called) and hope for an anwser one way or another soon.

Unfortunately I suspect that any solution is only going to work in IE4. There is definately not going to be a solution for version 2 browser and it is highly unlikely that there will be a solution for version3 browsers or even Netscape 4.

In general IE4 has much more ocntrol over document objects due to its much larger CSS capapility.

I'll let you know as soon as I get a response.

Trevor.


Author

Commented:
Trevor -

Much obliged for all the help. I kinda suspected we wouldn't be able to do it, but I told them I would check into it. You can submit your next comment as a answer so that I can hook you up with some points for your efforts.

Thanks
Adam
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Dyrewolf,

Thanks for the points, sorry I can't give a more definative answer at this time, but I'll keep you posted.

Trevor.

Author

Commented:
Wouldn't it be really sweet of somebody actually made Netscape and MS share standards? This would be so much easier. : )

Again, thanks a ton for the help, and let me know if you find out any other details.

Adam
Dyrewolf,

I think that is every web programmers dream!!  A virtual world where Netscape and Microsoft develop languages and features to a common standard.  Maybe one day.

Thanks for the 'A'.

Trevor.


Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.