Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > showing scroll bars in drop-down list

Reply
Thread Tools

showing scroll bars in drop-down list

 
 
Loane Sharp
Guest
Posts: n/a
 
      10-19-2004
Hi there,
I have several drop-down boxes in my form, and when I click on the drop-down
box to reveal the options, sometimes the list of options opens upward (above
the box) and sometimes downward (below the box), depending on the number of
options in each drop-down. Apparently there is a default mechanism at work
that displays the options in a visible part of the screen.

This looks very messy ... some boxes open up, some down, some in the middle
.... so within JavaScript I use the following ~

form1.select1.options.length = "8";

~ to limit the number of options displayed in a particular list to 18.

However I lose the scroll bars in the drop-down list when I do this.

Is there an alternative way to do this, or is there a way to show the scroll
bars?

Cheers
Loane


 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      10-19-2004
On Tue, 19 Oct 2004 17:47:24 +0200, Loane Sharp <(E-Mail Removed)>
wrote:

> I have several drop-down boxes in my form, and when I click on the
> drop-down box to reveal the options, sometimes the list of options
> opens upward (above the box) and sometimes downward (below the box),
> depending on the number of options in each drop-down. Apparently there
> is a default mechanism at work that displays the options in a visible
> part of the screen.


That's the standard operating system display. It's to prevent the drop
down from vanishing off the edge of the window.

> This looks very messy ... some boxes open up, some down, some in the
> middle


It's what the users are used to. Changing it can be risky as users may
become disorientated when what looks like a standard form element starts
behaving in a non-standard way.

> ... so within JavaScript I use the following ~
>
> form1.select1.options.length = "8";
>
> ~ to limit the number of options displayed in a particular list to 18.


8 or 18? I presume 8, as 18 would still display scrollbars on Windows.

> However I lose the scroll bars in the drop-down list when I do this.


No you don't. You lose all the options in the drop down after the 8th one.

If you changed your JS to this:
form1.select1.options.length = "8";
form1.select1.options.length = "20";
you would then see that all the options after the 8th are blank. You
deleted them with the first line of code and the second line of code
merely inserted blank options.

So the reason there are no scrollbars is because they're not needed -
there are no more options to be seen.

> Is there an alternative way to do this, or is there a way to show the
> scroll bars?


Stop worrying about trying to change default OS behaviours.

Steve
 
Reply With Quote
 
 
 
 
Loane Sharp
Guest
Posts: n/a
 
      10-19-2004
Hi Steve

So can it be done?


"Steve Pugh" <(E-Mail Removed)> wrote in message
newspsf4kgdml06el5p@staff6...
> On Tue, 19 Oct 2004 17:47:24 +0200, Loane Sharp <(E-Mail Removed)>
> wrote:
>
>> I have several drop-down boxes in my form, and when I click on the
>> drop-down box to reveal the options, sometimes the list of options
>> opens upward (above the box) and sometimes downward (below the box),
>> depending on the number of options in each drop-down. Apparently there
>> is a default mechanism at work that displays the options in a visible
>> part of the screen.

>
> That's the standard operating system display. It's to prevent the drop
> down from vanishing off the edge of the window.
>
>> This looks very messy ... some boxes open up, some down, some in the
>> middle

>
> It's what the users are used to. Changing it can be risky as users may
> become disorientated when what looks like a standard form element starts
> behaving in a non-standard way.
>
>> ... so within JavaScript I use the following ~
>>
>> form1.select1.options.length = "8";
>>
>> ~ to limit the number of options displayed in a particular list to 18.

>
> 8 or 18? I presume 8, as 18 would still display scrollbars on Windows.
>
>> However I lose the scroll bars in the drop-down list when I do this.

>
> No you don't. You lose all the options in the drop down after the 8th one.
>
> If you changed your JS to this:
> form1.select1.options.length = "8";
> form1.select1.options.length = "20";
> you would then see that all the options after the 8th are blank. You
> deleted them with the first line of code and the second line of code
> merely inserted blank options.
>
> So the reason there are no scrollbars is because they're not needed -
> there are no more options to be seen.
>
>> Is there an alternative way to do this, or is there a way to show the
>> scroll bars?

>
> Stop worrying about trying to change default OS behaviours.
>
> Steve



 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      10-19-2004
On Tue, 19 Oct 2004 18:24:57 +0200, "Loane Sharp"
<(E-Mail Removed)> wrote:

>So can it be done?


Can what be done? Can you force a drop down to always go down even if
that means it goes off the edge of the screen? No.

And please do not top post.

Steve

 
Reply With Quote
 
Loane Sharp
Guest
Posts: n/a
 
      10-19-2004
Hi Steve

That's pretty much what I'm trying to prevent. I'll let you know what I find


"Steve Pugh" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Tue, 19 Oct 2004 18:24:57 +0200, "Loane Sharp"
> <(E-Mail Removed)> wrote:
>
>>So can it be done?

>
> Can what be done? Can you force a drop down to always go down even if
> that means it goes off the edge of the screen? No.
>
> And please do not top post.
>
> Steve
>



 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      10-20-2004
On Wed, 20 Oct 2004 00:35:18 +0200, "Loane Sharp"
<(E-Mail Removed)> wrote:

>"Steve Pugh" <(E-Mail Removed)> wrote in message
>news(E-Mail Removed).. .
>> On Tue, 19 Oct 2004 18:24:57 +0200, "Loane Sharp"
>> <(E-Mail Removed)> wrote:
>>
>>>So can it be done?

>>
>> Can what be done? Can you force a drop down to always go down even if
>> that means it goes off the edge of the screen? No.
>>

>That's pretty much what I'm trying to prevent. I'll let you know what I find


Huh? You're trying to prevent something that the operating system
already prevents automatically? So doing nothing will do exactly what
you want?

Or do you have a page that shows us a drop down going off the edge of
the screen? URL please?

>> And please do not top post.


Did you not understand this?
http://www.html-faq.com/etiquette/?toppost

Steve

 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-20-2004
In alt.html Steve Pugh said:

>>> Can what be done? Can you force a drop down to always go down even if
>>> that means it goes off the edge of the screen? No.


>>That's pretty much what I'm trying to prevent. I'll let you know what I find


> Huh? You're trying to prevent something that the operating system
> already prevents automatically?


an early .9 mozilla had a bug with the drop downs dropping up and going
off screen. i remember because i though it was funny and it made me
giggle.



--


v o i c e s
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a div with scroll bars - can we get the scroll bars on the left instead of the right side? UJ ASP .Net 1 11-01-2006 09:32 PM
More Problems - This time scroll bars Dennis M. Marks HTML 3 12-01-2003 09:42 PM
Pages validate nicely, but I can see the reason why the scroll bars don't work Paul F. Johnson HTML 4 09-17-2003 10:02 PM
Re: Horizontal scroll bars in IE6? rf HTML 0 07-24-2003 11:43 PM
Re: DIVs and overflow scroll bars S. Justin Gengo ASP .Net 0 07-18-2003 02:18 PM



Advertisments