I need to limit character input in a text field (using ASP.Net/JavaScript/JQuery) to only allow characters in the ISO/IEC 8859-1 charset.
How would I do this?
I need to limit character input in a text field (using ASP.Net/JavaScript/JQuery) to only allow characters in the ISO/IEC 8859-1 charset.
How would I do this?
Just set the charset of the page to ISO-8859-1 using <meta charset="ISO-8859-1"> then use a regexp like the following [\x20-\x7E\xA0-\xFF]. The regex will match any visible characters from ISO-8859-1
This answer shows how to restrict input based on regex.