help on javascript:

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • timothy ma and constance lee

    help on javascript:

    I got the problem on passing the selected index of drop list to the
    javascript function as below:

    onchange:javasc ript:generateUR L(servername,
    this.options.[selectedIndex].value, docID)

    where i want to generate something like

    http://www.abc.com?param?imagecursor=docID#0001

    where servername = www.bac.com
    imagecursor=doc ID+selectedInde x padded with 0


  • McKirahan

    #2
    Re: help on javascript:

    "timothy ma and constance lee" <timcons1@shaw. ca> wrote in message
    news:3Ocfd.2244 1$%k.11206@pd7t w2no...[color=blue]
    > I got the problem on passing the selected index of drop list to the
    > javascript function as below:
    >
    > onchange:javasc ript:generateUR L(servername,
    > this.options.[selectedIndex].value, docID)
    >
    > where i want to generate something like
    >
    > http://www.abc.com?param?imagecursor=docID#0001
    >
    > where servername = www.bac.com
    > imagecursor=doc ID+selectedInde x padded with 0[/color]


    Try
    this.options.[this.selectedIn dex].value
    instead of
    this.options.[selectedIndex].value


    Comment

    • Martin Walke

      #3
      Re: help on javascript:

      Not sure whether you want to pass the value from the options list or just
      the index but either way you should be using 'this.options.s electedIndex'
      i.e.

      onchange:javasc ript:generateUR L(servername,
      this.options.[this.options.se lectedIndex].value, docID) or

      onchange:javasc ript:generateUR L(servername, this.options.se lectedIndex,
      docID) or


      HTH
      Martin



      "timothy ma and constance lee" <timcons1@shaw. ca> wrote in message
      news:3Ocfd.2244 1$%k.11206@pd7t w2no...[color=blue]
      > I got the problem on passing the selected index of drop list to the
      > javascript function as below:
      >
      > onchange:javasc ript:generateUR L(servername,
      > this.options.[selectedIndex].value, docID)
      >
      > where i want to generate something like
      >
      > http://www.abc.com?param?imagecursor=docID#0001
      >
      > where servername = www.bac.com
      > imagecursor=doc ID+selectedInde x padded with 0
      >
      >[/color]


      Comment

      Working...