Put your text ad here
WestNIC provides reliable web hosting services
This FAQ answers one of over 700 Web development questions submitted by Code Style readers. Sign-up to our premium content service to view the full answer.
A: It is possible to check for Latin 1 characters using Javascript, though the usual conditions apply; if Javascript is not enabled, no check will be made, so it is better to do this kind of thing on the server side, or double-up with both.
One relatively simple way to check for non-Latin characters would be to define a single string that contains all valid Latin 1 characters. Loop through each character in the input string and check it is in the reference string. The working example below includes utilities to generate the reference character set and non-Latin characters to test.
… premium content omitted
Access all premium content for $50: sign-up below.
Is it possible to filter non-Latin 1 characters?
Come inside, access hundreds of premium content answers. One payment grants life membership to hundreds of developer FAQs.
The PayPal service allows you to pay securely and independently in your own currency. Payments are billed to Metacentric Internet Limited. We never handle your credit card details.
Direct access to hundreds of answers to common Web development questions with full working examples and links to other Web resources. Your subscription provides full answers to all premium content questions including those listed below, plus:
onclick event on my button is not working! (stub article)
iframe browser and filter the URLs? (stub article)