Form drop down help (null values)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark

    #1

    Form drop down help (null values)

    I'm trying to make a drop down menu, when you select a few options I want it
    to do *nothing* at all, null. The following works perfectly in IE6, but it
    doesn't seem to worm in Opera 6 and IE5. When I select the valued options,
    then do nothing too. Can anyone please have a quick look @ this code and
    help me out a little :


    <form method="post" action="#">
    <select name="dropdown" onChange="javas cript:if (this.value !=
    0){location.hre f(this.value)}; ">
    <option value="">Please Choose...</option>
    <option value="">~~~~~~ ~~~~~~~~</option>
    <option value="1.php">O ranges</option>
    <option value="2.php">A pples</option>
    <option value=""></option>
    </select>
    </form>



  • Sergey I.Grachyov

    #2
    Re: Form drop down help (null values)

    Hi!

    Use something like

    if (this.options[this.selectedIn dex].value) {location.href =
    this.options[this.selectedIn dex].value}

    Here "selectedIn dex" is # of selceted 'option'.

    --
    Sergey.



    "mark" <noemailforusen e@blahblahblahb s.com> wrote in message
    news:bmtnn1$99i $1@news8.svr.po l.co.uk...[color=blue]
    > I'm trying to make a drop down menu, when you select a few options I want[/color]
    it[color=blue]
    > to do *nothing* at all, null. The following works perfectly in IE6, but it
    > doesn't seem to worm in Opera 6 and IE5. When I select the valued options,
    > then do nothing too. Can anyone please have a quick look @ this code and
    > help me out a little :
    >
    >
    > <form method="post" action="#">
    > <select name="dropdown" onChange="javas cript:if (this.value !=
    > 0){location.hre f(this.value)}; ">
    > <option value="">Please Choose...</option>
    > <option value="">~~~~~~ ~~~~~~~~</option>
    > <option value="1.php">O ranges</option>
    > <option value="2.php">A pples</option>
    > <option value=""></option>
    > </select>
    > </form>
    >
    >
    >[/color]


    Comment

    • mark

      #3
      Re: Form drop down help (null values)

      "Sergey I.Grachyov" <grachyov@infop ro.spb.su> wrote in message
      news:bmtojm$g0u $1@news.peterli nk.ru...[color=blue]
      > Hi!
      >
      > Use something like
      >
      > if (this.options[this.selectedIn dex].value) {location.href =
      > this.options[this.selectedIn dex].value}[/color]

      excellent!! that works great

      many thanks

      mark


      Comment

      Working...