showing scroll bars in drop-down list

Discussion in 'HTML' started by Loane Sharp, Oct 19, 2004.

  1. Loane Sharp

    Loane Sharp Guest

    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
    Loane Sharp, Oct 19, 2004
    #1
    1. Advertising

  2. Loane Sharp

    Steve Pugh Guest

    On Tue, 19 Oct 2004 17:47:24 +0200, Loane Sharp <>
    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
    Steve Pugh, Oct 19, 2004
    #2
    1. Advertising

  3. Loane Sharp

    Loane Sharp Guest

    Hi Steve

    So can it be done?


    "Steve Pugh" <> wrote in message
    news:eek:psf4kgdml06el5p@staff6...
    > On Tue, 19 Oct 2004 17:47:24 +0200, Loane Sharp <>
    > 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
    Loane Sharp, Oct 19, 2004
    #3
  4. Loane Sharp

    Steve Pugh Guest

    On Tue, 19 Oct 2004 18:24:57 +0200, "Loane Sharp"
    <> 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
    Steve Pugh, Oct 19, 2004
    #4
  5. Loane Sharp

    Loane Sharp Guest

    Hi Steve

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


    "Steve Pugh" <> wrote in message
    news:p...
    > On Tue, 19 Oct 2004 18:24:57 +0200, "Loane Sharp"
    > <> 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
    >
    Loane Sharp, Oct 19, 2004
    #5
  6. Loane Sharp

    Steve Pugh Guest

    On Wed, 20 Oct 2004 00:35:18 +0200, "Loane Sharp"
    <> wrote:

    >"Steve Pugh" <> wrote in message
    >news:p...
    >> On Tue, 19 Oct 2004 18:24:57 +0200, "Loane Sharp"
    >> <> 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
    Steve Pugh, Oct 20, 2004
    #6
  7. Loane Sharp

    brucie Guest

    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
    brucie, Oct 20, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    744
    Ben Strackany
    Jan 7, 2005
  2. UJ
    Replies:
    1
    Views:
    558
    John Timney \(MVP\)
    Nov 1, 2006
  3. weiwei
    Replies:
    0
    Views:
    1,002
    weiwei
    Jan 5, 2007
  4. Eric Cavanaugh

    drop down boxe size, no scroll bars

    Eric Cavanaugh, May 21, 2004, in forum: ASP General
    Replies:
    2
    Views:
    115
    Eric Cavanaugh
    May 21, 2004
  5. Replies:
    5
    Views:
    254
Loading...

Share This Page