Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove scrollbar in a Combo box

Status
Not open for further replies.

yuli1104

Programmer
Feb 20, 2002
60
CA
Hello,

I need to create a drop down list box that has 14 items. However it should display only one line initally. Then when the user clicks on it, it should drop down to display all the 14 items without the scrollbar.
<select name=&quot;name1&quot; size=1>
<option>op1
<option>op2
:
:
<option>op14
</select>
It works fine in Netscape 7.01. i.e, it displays all the 14 items without scrollbar when the user clicks the little triangle. But when I use IE5.50, It displays the scrollbar.
how can I remove the scrollbar in IE. please remember that I want it initially displays one line, that means I can't change the size attribute.

Please, I need your help urgently. Thanks!!

Yuli
 
set the size to the amount of items in the box. _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
Thank you, onpnt. but it doesn't work. As I said, the combo box needs to display one line initially. If you set the size = 14, the box immediatelly displays 14 items. I don't want it. only after the user click the pull-down triangle, all 14 items needed to be displayed without the scrollbar.

Yuli
 
I'm not able to find a method to do this either, except keep your option count below 11. Once there are 12 or more choices, the scrollbar appears.

If it were that important to me, then instead of a combo box, I'd just dynamically create a window of the appropriate height and location such that it simulates a combo box. It's a lot of work and probably not worth the effort, but if you or your Client insists that scroll bars are grotesque, then it seems to be your only option...

Good luck!

Edward &quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Actually in my case, there are 12 items in the combo box. That is why the clients hate the scrollbar for that extra item. (compared to 11).

It is part of a big online transaction and many (more than 500) clients use it every day. I can't simulates it by using a window since other parts use it too.

Thanks! Please keep helping.

Yuli
 
Well, I think that's just how IE interprets the select tag. Other browsers probably try to see what fits and IE just decideds if 12 or more, throw a scrollbar in.

Your client can complain about having to use two digits to represent &quot;11&quot;, but still insist on using base-10. It just comes with the territory.

I suppose you might find an uncompiled version of IE and try to locate the part that specifies how many items in the option will trigger a scrollbar and then recompile it and then make it available on your website and tell people to download it, but, well, it gets ugly after that. [smile].

If you have a heavy transaction site going on, then it might be worth it to you to find a JavaScript menu function that pops a very specific window, given all the various parameters. So at least you'll be able to implement it across the board.

The easiest solution is to tell your Client that although it's possible to create something that uses no scroll bars unless necessary, it's extremely impractical to implement.

Or, someone might show me up in a few seconds.

Cheers,

Edward &quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top