I have a textbox, and it needs not allow the user to enter any special characters. He can enter:
O
You should check pressed key in onkeydown event handler of the textbox and if it doesn't conform conditions then return false from the handler. Using keyup will not allow you to prevent char from being actually inputted in the textbox.
return false