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
%>
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
%>