Problem with keystroke delay

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ez2cwhy@gmail.com

    Problem with keystroke delay

    I'm relatively new to using javascript, so I'm not sure if this is a
    known problem, or something that I'm doing wrong. (99.9% sure it's
    something I'm doing wrong.) Here's the situation:

    I have a form that I am processing. Whenever the user types into any
    box, the "clear" button becomes activated. Otherwise, it is inactive.
    (Enabled/Disabled) My problem is that my button seems to be one stroke
    behind. So if I have a box and type in 'a', then nothing happens.
    However, if I type in another 'a', then the box enables as expected.
    Same thing goes for backspace...whe n I clear out the box, the button is
    still enabled. If I backspace one more time, then it disables.

    Anyone able to point me in the right direction?

    Thanks!

  • RobB

    #2
    Re: Problem with keystroke delay

    ez2c...@gmail.c om wrote:[color=blue]
    > I'm relatively new to using javascript, so I'm not sure if this is a
    > known problem, or something that I'm doing wrong. (99.9% sure it's
    > something I'm doing wrong.) Here's the situation:
    >
    > I have a form that I am processing. Whenever the user types into any
    > box, the "clear" button becomes activated. Otherwise, it is[/color]
    inactive.[color=blue]
    > (Enabled/Disabled) My problem is that my button seems to be one[/color]
    stroke[color=blue]
    > behind. So if I have a box and type in 'a', then nothing happens.
    > However, if I type in another 'a', then the box enables as expected.
    > Same thing goes for backspace...whe n I clear out the box, the button[/color]
    is[color=blue]
    > still enabled. If I backspace one more time, then it disables.
    >
    > Anyone able to point me in the right direction?
    >
    > Thanks![/color]

    Code? Can't debug what we can't see.

    A guess: whatever you're using, it's probably called from the
    Input.onkeypres s handler - which runs *before* the just-keyed character
    is output from the buffer. Try 'onkeyup' for a different result.

    Comment

    • Sushi Man

      #3
      Re: Problem with keystroke delay

      One other question about my form. When I use the "Clear" button, which
      is a reset button, is there a way to disable it. I tried a call with
      onclick, but it had non-desired results...i.e. it disabled the button
      but did not reset the form as well.

      Thanks again!

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Problem with keystroke delay

        ez2cwhy@gmail.c om wrote:
        [color=blue]
        > I have a form that I am processing. Whenever the user types into any
        > box, the "clear" button becomes activated. Otherwise, it is inactive.
        > (Enabled/Disabled)[/color]

        How are users without client-side scripting supposed to reset the form?
        Don't disable anything prior to user interaction without client-side
        scripting (unless you do a submit which will change its status).
        [color=blue]
        > My problem is that my button seems to be one stroke behind. So if I
        > have a box and type in 'a', then nothing happens. However, if I type
        > in another 'a', then the box enables as expected. Same thing goes for
        > backspace...whe n I clear out the box, the button is still enabled. If
        > I backspace one more time, then it disables.[/color]

        Maybe you are just using `onchange'. It fires after the focus
        left the element. If so, use `onkeyup' and `onkeypress' instead.


        PointedEars

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: Problem with keystroke delay

          Sushi Man wrote:
          [color=blue]
          > One other question about my form. When I use the "Clear" button, which
          > is a reset button, is there a way to disable it. I tried a call with
          > onclick, but it had non-desired results...i.e. it disabled the button
          > but did not reset the form as well.[/color]

          That's a known issue, same with submit buttons. There are Voodoo
          workarounds out there but I suggest just don't do either as there
          is no real need for it.


          PointedEars

          P.S.
          While you were able to change your From header, you could have had it
          displayed also your real name. In Usenet, there are people who are
          repelled by only pseudonymes/nicknames in the From header of postings
          while appear attracted to those posted by people with identity.

          Comment

          • Matthew Lock

            #6
            Re: Problem with keystroke delay


            Thomas 'PointedEars' Lahn wrote:[color=blue]
            > While you were able to change your From header, you could have had it
            > displayed also your real name. In Usenet, there are people who are
            > repelled by only pseudonymes/nicknames in the From header of postings
            > while appear attracted to those posted by people with identity.[/color]

            Says the person who goes by the name of PointedEars!

            Comment

            • Thomas 'PointedEars' Lahn

              #7
              Re: Problem with keystroke delay

              Matthew Lock schrieb:
              [color=blue]
              > Thomas 'PointedEars' Lahn wrote:[color=green]
              > > While you were able to change your From header, you could have had
              > > it displayed also your real name. In Usenet, there are people who[/color][/color]
              ^^^^^^^^^^^^^^^ ^^^^[color=blue][color=green]
              > > are repelled by only pseudonymes/nicknames in the From header of
              > > postings while appear attracted to those posted by people with
              > > identity.[/color]
              >
              > Says the person who goes by the name of PointedEars![/color]

              Yes, with nickname *included* in From header.


              PointedEars

              Comment

              Working...