Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2003, 09:34 AM
Authorized User
 
Join Date: Jun 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Check Latin characters in form

Hello all

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

Nikos
 
Old June 19th, 2003, 12:10 PM
Authorized User
 
Join Date: Jun 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This place DOES NOT WORK!!!

p2p used to be a great community, where i could get answers within minutes.

Pitty........
 
Old June 19th, 2003, 12:35 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

Rather than assuming no one is here or reading your post, maybe instead it's that nobody has an answer for your question.

Would it be more helpful if we posted responses saying we don't know?

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
 
Old June 20th, 2003, 05:41 AM
Authorized User
 
Join Date: Jun 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, dont reply anything. I can figure out that nobody knows.

I just remember that previously, it just never happend in my (hundreds of) questions.

Pitty again....
 
Old June 27th, 2003, 06:08 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:Originally posted by nikosdra
 Hello all

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

Nikos
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:

Code:
dim i
dim badChar
dim stringToCheck
dim ch

stringToCheck=Request.Form("textinput") ' where textinput is your form field name
badChar=false

i=1
while i<=len(stringToCheck) and not(badChar)
    ch=lcase(mid(stringToCheck,i,1))
    if not((ch >= "a" and ch <= "z") or (ch >= "0" and ch <= "9") or (ch=" ")) then
        badChar=true
    end if
    i=i+1
wend

if badChar then
    ' Report an error
end if
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.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with ASP e-mail for non-Latin characters nikosdra Classic ASP Basics 12 October 23rd, 2008 06:19 AM
pig latin xeo VBScript 2 May 28th, 2008 01:00 PM
Entering special characters on the form MyronCope Classic ASP Basics 1 November 21st, 2006 09:27 AM
Latin letters itHighway Classic ASP Professional 3 July 20th, 2006 12:14 AM
ASP E-mail problem with non-Latin characters nikosdra Classic ASP Components 1 July 25th, 2004 10:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.