calling an event on a Key Press

Last post 06-11-2008 7:43 PM by timePass. 2 replies.

Sort Posts:

  • calling an event on a Key Press

    06-11-2008, 5:30 PM
    • Member
      point Member
    • timePass
    • Member since 06-11-2008, 5:19 PM
    • Posts 2
    I have a bar code reader which when scans a barcode reads an item number and fills the item number into a Text Box(Similar to the key press from a key board). I want to call an event automatically once the text box is filled with the item number(The user doesn't press ENTER or TAB key). The problem is that the length of the item number is not fixed. I have been pulling my hair for quiet some time but no hope. Any explanation on how to achieve this and sample code will be highly appreciated. Thanks in advance.
  • Re: calling an event on a Key Press

    06-11-2008, 7:02 PM
    • Contributor
      5,401 point Contributor
    • AceCorban
    • Member since 08-23-2007, 3:43 PM
    • Monterey, CA
    • Posts 1,053

    I don't understand why you can't call the event after you have populated the text box.  Does it fill the textbox one item at a time?  If that's the case, perhaps you could use a timeout if it is client-side javascript.  You'd basically refresh a timeout that you keep resetting every time a character is input into the textbox, then whenever the timeout runs out, there hasn't been any refreshes, so the textbox is probably filled.

    What side is populating the textbox server or client?  Are there other form items? 

    I never lose, some people are just better than me at winning.
  • Re: calling an event on a Key Press

    06-11-2008, 7:43 PM
    • Member
      point Member
    • timePass
    • Member since 06-11-2008, 5:19 PM
    • Posts 2
    populating the TB is on the client side. I wanted to call the event automatically.the bar code reader reads in a set of characters as a keystrokes from the keyboard. Once it is done reading it I should call the event. The refreshes of the time helps but its lose in performance for I dont know how long it will take to read my barcode.
Page 1 of 1 (3 items)