Forum Moderators: open

Message Too Old, No Replies

Adian character problem

How to stop users typing non-ASCII characters in a form field

         

Numpty

11:44 am on Sep 26, 2006 (gmt 0)

10+ Year Member



I have a website used by Japanese visitors.

The forms work with Japanese characters. However, there is one field that I want to allow Western charcters only.

Basically, it is a reference code built using a unique number in combination with the Lastname field. I don't want them to enter Japanese text in the Lastname field.

Anyone know of a way in ASP classic to achieve this?

Numpty

11:46 am on Sep 26, 2006 (gmt 0)

10+ Year Member



By the way, the title is supposed to say Asian!

mrMister

2:24 pm on Sep 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After the form is posted, do a character by character check to ensure each character is in the ISO 8859-1 range (use ASC in VBScript). Return an error if there are any unrecognised characters.

You should also check that your server is not telling the browser that it will accept the charcter-encodings that you don't want...

You should use a server header checker to look for the Accept-Charset header.