Results 1 to 3 of 3

Thread: How can I cancel input box event

  1. #1
    Join Date
    Mar 2010

    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.


  2. #2
    Join Date
    Jul 2008
    urbana, il
    move to onkeydown, return false to prevent key from being "typed"
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  3. #3
    Join Date
    Mar 2010
    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