Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
form validation with asp classic
Old 08-24-2007, 01:15 PM form validation with asp classic
Experienced Talker

Posts: 36
Trades: 0
can anyone point me towards learning how to do form validation with asp classic and not .net? or some sort of easy to implement solution using javascript or cgi or something?

thanks!
edzdallas79 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-25-2007, 08:33 AM Re: form validation with asp classic
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
it's just the same process in any language,

user submits form,
Code:
grab submitted variables,
check value and type are in range/present

Branch:  __   Ok; accept and continue
          |
          |___ Error; Return to user with error.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-25-2007, 09:14 AM Re: form validation with asp classic
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
You could use regular expressions in classic asp

Code:
Function validateEmail(email) 
  Set regEx = New RegExp 
  regEx.IgnoreCase = False
  regEx.Pattern = "^[\w-\.\+]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,6}$" 
  validateEmail = regEx.Test(Trim(email)) 
End Function

If Request.Form.Count > 0 Then
  If validateEmail(Request.Form("email")) Then
    Response.Write("You Entered a Valid Email Address")
  Else
    Response.Write("You Didnt Enter a Valid Email Address")
  End If
End If
Usage:
Code:
<form name="email" method="post" action="">
<input name="email" type="text"><input name="" type="submit" value="Submit">
</form>
The function returns a boolean value wich you can easily use to validate your form
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 08-25-2007, 02:12 PM Re: form validation with asp classic
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
What Chris and Daniel said. The exact nature of form validation depends on the form and what you want validated, but pretty well anything can be checked using classic ASP.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-25-2007, 03:53 PM Re: form validation with asp classic
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Ideally, you'd want to do as much validation as possible in client script, which can be disabled, but most people leave javascript running, and this will save you bandwidth and the user response time in 90 % of error cases.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to form validation with asp classic
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37818 seconds with 12 queries