History

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

    History

    Is it possible, while navigate in a page, to "save" number of clicks on
    some elements (checkbox) and after 20(or somewhat) clicks trigger some
    functions?

    Any help appreciated.

    Best regards.

    --
    Fabri
    (Incredibile come si tenda a credere di piu` a Rossi. (cit.))
  • VK

    #2
    Re: History

    <input
    type="checkbox"
    name="chk001"
    value="yes"

    onClick="this.c licks=(this.cli cks)?++this.cli cks:1;if(this.c licks>=20){myFu n
    ction(this);}">




    Comment

    • Evertjan.

      #3
      Re: History

      Fabri wrote on 17 dec 2004 in comp.lang.javas cript:
      [color=blue]
      > Is it possible, while navigate in a page, to "save" number of clicks on
      > some elements (checkbox) and after 20(or somewhat) clicks trigger some
      > functions?
      >[/color]

      <script>
      var count=0
      </script>

      <input type='checkbox'
      onclick="if(++c ount==20){alert (count+' clicks');count= 0;}">

      --
      Evertjan.
      The Netherlands.
      (Please change the x'es to dots in my emailaddress)

      Comment

      • Mick White

        #4
        Re: History

        Fabri wrote:[color=blue]
        > Is it possible, while navigate in a page, to "save" number of clicks on
        > some elements (checkbox) and after 20(or somewhat) clicks trigger some
        > functions?
        >[/color]

        Yes:
        gClicked=0
        element.onclick =function(){gCl icked++; if(gClicked>=20 ){//do stuff}}

        That's for one element, it could easily be adapted to accommodate any
        number of elements.

        Mick

        Comment

        • Fabri

          #5
          Re: History

          Thx all, but I don't know which checkbox user click.

          20 is number and it should be 19 on one and 1 on another or 1 on each
          checkbox.

          Is it possible?

          Regards.

          --
          Fabri
          (Incredibile come si tenda a credere di piu` a Rossi. (cit.))

          Comment

          • Fabri

            #6
            Re: History

            Mick White wrote:
            [color=blue]
            > Yes:
            > gClicked=0
            > element.onclick =function(){gCl icked++; if(gClicked>=20 ){//do stuff}}[/color]

            Thx Mick it works.

            --
            Fabri
            (Incredibile come si tenda a credere di piu` a Rossi. (cit.))

            Comment

            Working...