Struggling with listbox height

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • birdy
    New Member
    • Apr 2008
    • 1

    Struggling with listbox height

    Hello all, I found a slight problem that is puzzling me

    What I want,
    - When I have a drop down box on a screen it should be size=1.
    - When I click on the drop down box, ALL values should be displayed
    - When I click on a value in the drop down box, the value should be selected and the drop down box should close (to size=1)

    The above works great if there are 11 or less items in your drop down box. If there are more then a scrollbar will be shown on the right side. I do not wish the scrollbar to appear, I want to show all values without the need to scroll.

    I managed a sorta workaround but I lose the functionality of the drop down box, that the values of the drop down box appear above the screen without altering the layout of the screen.
    So I want best of both worlds: all values should appear in the dropped down box when I click on it without altering the layout of the page it is on
    I can best explain it with my examples:



    Code:
    <html>
    <body>
    <form action="">
    TEST1
    <select name="cars" >  
      <option value=" "> </option>
      <option value="volvo">Volvo</option>
      <option value="saab">Saab</option>
      <option value="fiat">Fiat</option>
      <option value="audi">Audi</option>
      <option value="audi">Audi2</option>
      <option value="audi">Audi3</option>
      <option value="audi">Audi4</option>
      <option value="audi">Audi5</option>
      <option value="audi">Audi6</option>
      <option value="audi">Audi7</option>
      <option value="audi">Audi8</option>
      <option value="audi">Audi9</option>
      <option value="audi">Audi10</option>
      <option value="audi">Audi11</option>
      <option value="audi">Audi12</option>
    </select></p>
    TEST2
    
    <select name="cars" onClick="size=1" onMouseOver="size=16" onMouseOut="size=1"
       >  
      <option value=" "> </option>
      <option value="volvo">Volvo</option>
      <option value="saab">Saab</option>
      <option value="fiat">Fiat</option>
      <option value="audi">Audi</option>
      <option value="audi">Audi2</option>
      <option value="audi">Audi3</option>
      <option value="audi">Audi4</option>
      <option value="audi">Audi5</option>
      <option value="audi">Audi6</option>
      <option value="audi">Audi7</option>
      <option value="audi">Audi8</option>
      <option value="audi">Audi9</option>
      <option value="audi">Audi10</option>
      <option value="audi">Audi11</option>
      <option value="audi">Audi12</option>
    </select></p>
    </form>
    Last edited by eWish; Apr 2 '08, 07:58 PM. Reason: Please use code tags
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    This is an issue with the onMouse function not an HTML issue. Moving thread to JavaScript.

    --Kevin

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      onClick="this.s ize=1"

      See if this works...

      Comment

      Working...