How to disallow characters (and replace them) on type or paste with jQuery?
问题 I’m trying to find a way to replace disallowed characters from being entered or pasted into all input fields (textboxes and textareas essentially) in a form. Any time a user pastes text that contains one or more disallowed characters I would want the character replaced with an empty string ‘’ but have the rest of the text intact. If they type and type the character I would just want “nothing” to happen (e.g. the character not to appear if they type it). Is there a code sample that exists on