Class Cls_Fun
Private x,y,ii
==============================
函 數 名:AlertInfo
作 用:錯誤顯示函數
參 數:錯誤提示內容InfoStr,轉向頁面GoUrl
==============================
Public Function AlertInfo(InfoStr,GoUrl)
If GoUrl="1" Then
Response.Write "<Script>alert('"& InfoStr &"');location.href='javascript:history.go(-1)';</Script>"
Else
Response.Write "<Script>alert('"& InfoStr &"');location.href='"& GoUrl &"';</Script>"
End If
Response.End()
End Function
==============================
函 數 名:HTMLEncode
作 用:字符轉換函數
參 數:需要轉換的文本fString
==============================
==============================
函 數 名:AlertNum
作 用:判斷是否是數字(驗證字符,不為數字時的提示)
參 數:需進行判斷的文本CheckStr,錯誤提示ErrStr
==============================
Public Function AlertNum(CheckStr,ErrStr)
If Not IsNumeric(CheckStr) or CheckStr="" Then
Call AlertInfo(ErrStr,"1")
End If
End Function
==============================
函 數 名:AlertString
作 用:判斷字符串長度
參 數:
需進行判斷的文本CheckStr
限定最短ShortLen
限定最長LongLen
驗證類型CheckType(0兩頭限制,1限制最短,2限制最長)
過短提示LongStr
過長提示LongStr,
==============================
Public Function AlertString(CheckStr,ShortLen,LongLen,CheckType,ShortErr,LongErr)
If (CheckType=0 Or CheckType=1) And StringLength(CheckStr)<ShortLen Then
Call AlertInfo(ShortStr,"1")
End If
If (CheckType=0 Or CheckType=2) And StringLength(CheckStr)>LongLen Then
Call AlertInfo(LongStr,"1")
End If
End Function
==============================
函 數 名:AlertNum
作 用:判斷是否是數字(驗證字符,不為數字時的提示)
參 數:需進行判斷的文本CheckStr,錯誤提示ErrStr
==============================
Public Function ShowNum(CheckStr,ErrStr)
If Not IsNumeric(CheckStr) or CheckStr="" Then
Response.Write(ErrStr&"|||||")
PageErr=1
End If
End Function
==============================
函 數 名:ShowString
作 用:判斷字符串長度
參 數:
需進行判斷的文本CheckStr
限定最短ShortLen
限定最長LongLen
驗證類型CheckType(0兩頭限制,1限制最短,2限制最長)
過短提示LongStr
過長提示LongStr,
==============================
Public Function ShowString(CheckStr,ShortLen,LongLen,CheckType,ShortErr,LongErr)
If (CheckType=0 Or CheckType=1) And StringLength(CheckStr)<ShortLen Then
Response.Write(ShortErr&"|||||")
PageErr=1
End If
If (CheckType=0 Or CheckType=2) And StringLength(CheckStr)>LongLen Then
Response.Write(LongErr&"|||||")
PageErr=1
End If
End Function
a
==============================
函 數 名:BeSelect
作 用:判斷select選項選中
參 數:Select1,Select2
==============================
Public Function BeSelect(Select1,Select2)
If Select1=Select2 Then
BeSelect=" selected='selected'"
End If
End Function
==============================
函 數 名:BeCheck
作 用:判斷Check選項選中
參 數:Check1,Check2
==============================
Public Function BeCheck(Check1,Check2)
If Check1=Check2 Then
BeCheck=" checked='checked'"
End If
End Function