Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Form Validation

Reply
Thread Tools

Form Validation

 
 
solomon_13000
Guest
Posts: n/a
 
      06-15-2006
What is the best way to validate a form field and display an error
message. Are there better examples than shown bellow?

<%
Sub ValidateForm(sValue,count)
If Len(Trim(sValue)) > count then
session("boolean") = false
else
session("boolean") = true
end if
End sub

If request.queryString("Action") = 2 then
username = ValidateForm(request.form("username"),12)
if session("boolean") = true then
password = ValidateForm(request.form("password,12)
if session("boolean") = false then
.....other codes
else
'display error msg
end if
else
'display error msg
end if
end if

%>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A form validation library with javascript validation Grigory Temchenko Python 0 12-28-2008 08:38 PM
string validation/ form validation OriginalBrownster Python 1 08-21-2006 01:50 AM
Struts validation for combine form fields validation Sumith Mathur Java 0 09-23-2004 06:26 PM
Form Validation Problem...Persisiting form fields on validation failure. bnp Javascript 4 05-12-2004 12:16 PM
Web form validation vs object validation Colin Basterfield ASP .Net 1 11-29-2003 12:10 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57