Droplist

Discussion in 'HTML' started by Linda, Sep 9, 2008.

  1. Linda

    Linda Guest

    Is there a way to have a blank line between each
    <option>My Line</option>?

    I have tried a <br> and <hr color="white"> and neither work.

    Linda
    Linda, Sep 9, 2008
    #1
    1. Advertising

  2. Linda

    Andy Guest

    "Linda" <> wrote in message
    news:...
    > Is there a way to have a blank line between each
    > <option>My Line</option>?
    >
    > I have tried a <br> and <hr color="white"> and neither work.
    >
    > Linda
    >


    Hi Linda,

    This is how I do it...

    <select>
    <option>Red T-Shirt Small</option>
    <option>Red T-Shirt Medium</option>
    <option>Red T-Shirt Large</option>
    <option>
    <option>Green T-Shirt Small</option>
    <option>Green T-Shirt Medium</option>
    <option>Green T-Shirt Large</option>
    <option>
    <option>Blue T-Shirt Small</option>
    <option>Blue T-Shirt Medium</option>
    <option>Blue T-Shirt Large</option>
    </select>

    ....this will put a blank line between the red, green and blue t-shirts in
    the dropdown options list.

    If you wanna finish it off a bit you could do this...

    <select id="t-shirts" onChange="testforspace('t-shirts')">
    <option>Red T-Shirt Small</option>
    <option>Red T-Shirt Medium</option>
    <option>Red T-Shirt Large</option>
    <option>
    <option>Green T-Shirt Small</option>
    <option>Green T-Shirt Medium</option>
    <option>Green T-Shirt Large</option>
    <option>
    <option>Blue T-Shirt Small</option>
    <option>Blue T-Shirt Medium</option>
    <option>Blue T-Shirt Large</option>
    </select>

    <script>
    function testforspace(combo_id){
    var spacertest =
    document.getElementById(combo_id).options[document.getElementById(combo_id).options.selectedIndex].innerHTML;
    if (spacertest==''){
    alert('Please select a valid option from the dropdown menu list');
    }
    }
    </script>

    Hope this helps


    Andy
    Andy, Sep 10, 2008
    #2
    1. Advertising

  3. Andy wrote:
    >
    > "Linda" <> wrote in message
    > news:...
    >> Is there a way to have a blank line between each
    >> <option>My Line</option>?
    >>
    >> I have tried a <br> and <hr color="white"> and neither work.
    >>
    >> Linda
    >>

    >
    > Hi Linda,
    >
    > This is how I do it...
    >
    > <select>
    > <option>Red T-Shirt Small</option>
    > <option>Red T-Shirt Medium</option>
    > <option>Red T-Shirt Large</option>
    > <option>
    > <option>Green T-Shirt Small</option>
    > <option>Green T-Shirt Medium</option>
    > <option>Green T-Shirt Large</option>
    > <option>
    > <option>Blue T-Shirt Small</option>
    > <option>Blue T-Shirt Medium</option>
    > <option>Blue T-Shirt Large</option>
    > </select>


    Actually for that case OPTGROUP would serve the purpose semantically

    <select name="t-shirts">
    <optgroup label="Red T-Shirt">
    <option value="redsm">Red T-Shirt Small</option>
    <option value="redmd">Red T-Shirt Medium</option>
    <option value="redlg">Red T-Shirt Large</option>
    </optgroup>
    <optgroup label="Green T-Shirt">
    <option value="grnsm">Green T-Shirt Small</option>
    <option value="grnmd">Green T-Shirt Medium</option>
    <option value="grnlg">Green T-Shirt Large</option>
    </optgroup>
    <optgroup label="Blue T-Shirt">
    <option value="blusm">Blue T-Shirt Small</option>
    <option value="blumd">Blue T-Shirt Medium</option>
    <option value="blulg">Blue T-Shirt Large</option>
    </optgroup>
    </select>

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Sep 10, 2008
    #3
    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. Meir Rotfleisch

    Newbie Question about DropList and Page Load

    Meir Rotfleisch, Nov 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    333
    Thomas F.B.
    Nov 2, 2003
  2. Lasse Edsvik

    Filelist -> Droplist?

    Lasse Edsvik, Oct 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    403
    =?Utf-8?B?c3Jpbmk=?=
    Oct 4, 2004
  3. TJS
    Replies:
    4
    Views:
    2,950
  4. TJS
    Replies:
    2
    Views:
    681
  5. TJS
    Replies:
    5
    Views:
    2,078
    =?Utf-8?B?amZsZWVzb24=?=
    Mar 13, 2005
Loading...

Share This Page