quote:Originally posted by nikosdra
Does anybody know how can I check if my users have used Latin characters in the submitted form, or else give them a message that they have to fill in the form with Latin characters only?
Thanks in advance
Well I don't know any ASP check specifically geared towards checking only latin characters. You could loop through the characters from the text input and validate that they're all within the range you want.
Here's an example that checks for A-Z,a-z,0-9 and spaces:
stringToCheck=Request.Form("textinput") ' where textinput is your form field name
while i<=len(stringToCheck) and not(badChar)
if not((ch >= "a" and ch <= "z") or (ch >= "0" and ch <= "9") or (ch=" ")) then
if badChar then
' Report an error
If you wanted to check for additional characters, simply add an additional or
clause for those characters to the character check.
This could also probably be done more efficiently with regular expressions but I don't have the time to look it up right now.
Director, Applications & Support Services
Wiley Publishing, Inc.