Form Validation

S

solomon_13000

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

%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top