Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components 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 March 3rd, 2004, 06:05 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default check numeric

I have a form with input fields

the user inputs a name

i want to validate that this name doesnt contain any numeric values..

i want it to be purely letters

how is that?

Isnumeric only checks for if all the input is numeric not eahc character

HELP

__________________
What Comes Around Goes Around!
 
Old March 3rd, 2004, 06:30 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Use a regular expression like this:
Code:
function validate(oTextbox)
{
    if ( /[^a-zA-Z]/.test(oTextbox.value) )
    {
         alert("failed validation");
    }
}
BTW that's client-side js. I can give you the corresponding code for server-side VBS if you want it.

hth
Phil
 
Old March 3rd, 2004, 06:40 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah actually i am lookign for server side validation in Asp

 
Old March 3rd, 2004, 07:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

No Problem, try this:
Code:
Dim re
Set re = New RegExp
re.Pattern = "[^a-zA-Z]"
If re.Test( Request.Form("input name") ) Then
    ' failed validation
End If




Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to VSS check-in Check-out Programatically rhd110 General .NET 6 August 12th, 2007 07:46 AM
From numeric to alfa numeric ebekir XSLT 1 August 10th, 2007 06:13 AM
How can i know it's NUMERIC deco Beginning VB 6 1 April 23rd, 2007 06:19 AM
Numeric Up Down Kunkel General .NET 0 April 16th, 2004 10:07 AM
Numeric Check in Query jepley Oracle 1 September 15th, 2003 03:59 PM





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