we run a web2print solution, that some people fill out a form to update some artwork.
The problem is some users paste in text from word or other programs, and get weird dashes, spaces etc that aren't 开发者_运维知识库a part of normal keyboard input.
What we want to do is restrict the input to all the "normal" keyboard keys, not the unmapped character codes. How do we do this?
Many thanks,
b
I would create an array or something of all keyboard keys and then remove all chars that don't match.
You can use encodeURIComponent(value)
function. It outputs safe coded UTF8 strings.
精彩评论