Results 1 to 4 of 4

Thread: Detecting immediate text entry in text box

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    61

    Detecting immediate text entry in text box

    I have created a form in HTML, which consists of a text box. Is there a javascript command/function which detects as soon as an entry has gone into the text box (eg onChange???), so I can then immediately call up a function to read and react to that entry?

    Thanks.

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    you can use onChange or onBlur.Attach these to the textbox itself.
    Have I helped you? Please Rate my posts.

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    61
    Thanks Acidic, but there's still a problem with my situation. Your solution works well when the user manually types his whole string into the text box, then text-input detection happens when the user takes the focus away from the text box.

    The situation is this. The text in the text box is not directly user-entered. The user makes some selection and a Javascript function writes the approriate text into the text-box. I need to detect as soon as text enters the box, not after the user has focussed away from the box.

    Hope you can help.

    Thanks.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Since modifying the text via JavaScript doesn't trigger key events, there's no way to do this except modifying the script that writes in the box.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width