onChange with checkbox

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

    onChange with checkbox

    I wanted to use onChange with some checkboxes. However, the function is only
    called when the focus is shifted to the next field.

    Instead I would like my function to be called as soon as the user changes
    the checkbox. Is that possible?

    Thanks,
    Wim


  • kaeli

    #2
    Re: onChange with checkbox

    In article <boart8$sgt$1@r eader08.wxs.nl> , wimroffelplease @nospamm-
    planet.nl enlightened us with...[color=blue]
    > I wanted to use onChange with some checkboxes. However, the function is only
    > called when the focus is shifted to the next field.
    >
    > Instead I would like my function to be called as soon as the user changes
    > the checkbox. Is that possible?
    >[/color]

    Any click changes the box for that element. Use onClick. Be careful -
    IIRC, the onClick fires *before* the "checked" property is changed.
    Check on that if you use it.


    -------------------------------------------------
    ~kaeli~
    Jesus saves, Allah protects, and Cthulhu
    thinks you'd make a nice sandwich.


    -------------------------------------------------

    Comment

    • Stuart Palmer

      #3
      Re: onChange with checkbox

      Yes, try onClick instead

      Stu

      "Wim Roffal" <wimroffelpleas e@nospamm-planet.nl> wrote in message
      news:boart8$sgt $1@reader08.wxs .nl...[color=blue]
      > I wanted to use onChange with some checkboxes. However, the function is[/color]
      only[color=blue]
      > called when the focus is shifted to the next field.
      >
      > Instead I would like my function to be called as soon as the user changes
      > the checkbox. Is that possible?
      >
      > Thanks,
      > Wim
      >
      >[/color]


      Comment

      • Stuart Palmer

        #4
        Re: onChange with checkbox

        or onMouseDown/onMouseUp

        "Stuart Palmer" <tryandspamme@y oucant.com> wrote in message
        news:boavo6$1ab c$1@sp15at20.hu rsley.ibm.com.. .[color=blue]
        > Yes, try onClick instead
        >
        > Stu
        >
        > "Wim Roffal" <wimroffelpleas e@nospamm-planet.nl> wrote in message
        > news:boart8$sgt $1@reader08.wxs .nl...[color=green]
        > > I wanted to use onChange with some checkboxes. However, the function is[/color]
        > only[color=green]
        > > called when the focus is shifted to the next field.
        > >
        > > Instead I would like my function to be called as soon as the user[/color][/color]
        changes[color=blue][color=green]
        > > the checkbox. Is that possible?
        > >
        > > Thanks,
        > > Wim
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Wim Roffal

          #5
          Re: onChange with checkbox

          Hi,

          Thanks to all who replied to my question. I'll go for the onClick!

          Wim


          "kaeli" <tiny_one@NOSPA M.comcast.net> schreef in bericht
          news:MPG.1a12bc 5f534575a998994 5@nntp.lucent.c om...[color=blue]
          > In article <boart8$sgt$1@r eader08.wxs.nl> , wimroffelplease @nospamm-
          > planet.nl enlightened us with...[color=green]
          > > I wanted to use onChange with some checkboxes. However, the function is[/color][/color]
          only[color=blue][color=green]
          > > called when the focus is shifted to the next field.
          > >
          > > Instead I would like my function to be called as soon as the user[/color][/color]
          changes[color=blue][color=green]
          > > the checkbox. Is that possible?
          > >[/color]
          >
          > Any click changes the box for that element. Use onClick. Be careful -
          > IIRC, the onClick fires *before* the "checked" property is changed.
          > Check on that if you use it.
          >
          >
          > -------------------------------------------------
          > ~kaeli~
          > Jesus saves, Allah protects, and Cthulhu
          > thinks you'd make a nice sandwich.
          > http://www.ipwebdesign.net/wildAtHeart
          > http://www.ipwebdesign.net/kaelisSpace
          > -------------------------------------------------[/color]


          Comment

          Working...