<%
'=================================================================
' version:1.0
' Data=2004-7-5
' Script written by: happy. NET (Nicholas)
'==================================================================
' CopyRight by: Kyushu Information Network Co., Ltd.
' Web:www.21hb.com
' Email:nicholas_cheung@21cn.com
'==================================================================
Class Cls_validator
Rem ======================= Validation class description ==============================
rem= role: For validation of input data
rem= Example: Set Va=new cls_validator
Rem= Va. Requirefield request ("ASD"), "Please re-enter the error"
rem=
rem=
rem==================================================================
Private Validator1,validator2
Public properties Get Validator () ' Define attributes: Validation
Validator=validator1
End Property
Public Property Let Validator (Validator2)
Validator1=validator2
End Property
The public Function Requirefield (requestfieled,errorname) ' ensures that the user does not jump the method ErrorName is the input string requestname the error message
If requestfieled= "" Then
Requirefield=false
Validator1=false
Response.Write (' <script lanuage= ' JavaScript ' >alert (' &errorname& '); History.back () </script> ")
Response.End ()
Else
Requirefield=true
Validator1=true
End If
End Function
Public Function CompareValidator (requestfieled1,requestfieled2,operator,errorname) ' The method of comparing validation requestfieled1, Requestfieled2 for input string operator ErrorName as error message
Select case Operator ' Judge comparison operator
Case ">"
if (not requestfieled1>requestfieled2) then
Comparevalidator=false
Validator1=false
Response.Write (' <script lanuage= ' JavaScript ' >alert (' &errorname& '); History.back () </script> ")
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.