www.webdeveloper.com
Results 1 to 3 of 3

Thread: How can I cancel input box event

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Posts
    48

    Question How can I cancel input box event

    Hi guys,

    I've been trying to do something and it's killing me because I can't figure out how to do it properly.

    I have an input box. I'm validating as the user types. Basically deleting forbidden characters as they type. I'm doing it with the onkeyup event. Problem is this looks kinda crappy because the character they type appears briefly and then get's deleted. I want to know how can I cancel the event that writes on the input box so that instead of deleting the character myself, I just cancel the event.

    I have no idea if the input box or the window is the one responsible for doing this.

    Hope you guys can help me.

    Thanks!

  2. #2
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    move to onkeydown, return false to prevent key from being "typed"

  3. #3
    Join Date
    Mar 2010
    Posts
    48
    Awesome, thanks so much!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles