How can I cancel input box event
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.
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
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread