Verify form

xiaoxiao2021-03-06  67

Ctrl c, then Ctrl V.

<%

'********************************************************** *****************************

'Function name: Checkform_JS (fmname, Errstr)

'Features: Method with ASP Dynamically Write the function of JavaScript's form verification CHECKSUBMIT ()

'Usage: 1, ;

'2,

;

'The author has forgotten, the secondary development of: Guo.Q.M

'Last updated: 2004

'********************************************************** *****************************

'help:

'------------------------------------- ----------------------------

'·Parameter Description:

'frmname: The name of the form field

'Errstr: Verification list, such as "NUM | 3 | Model must not be less than 8 digits | 8, Email | 5 | Please enter the correct email format", here

'NUM represents the table field name, 3 indicates the verification parameter, 8 indicates that the number of bits is not less than (optional)

'

'· Verification Parameter list:

'0: Required Text Type

'1: Required ListMenu type

'2: Must be numbed TEXT type

'3: Must be the TEXT type of the specified bit number

'4: must be greater than the TEXT type of the specified bit

'5: Must be the TEXT type of email

'6: TEXT type that must be a character of A-Z or 0-9

'7: Confirm that the password and password must be equal to TEXT type

'8: Confirm that it is not a TEXT type starting with a number

'9: Must contain the TEXT type 10-888888 format

'10: Do not contain the text type of Chinese, space, and other illegal characters, that is, only "_" "-" "0-9" "A-Z" a-z "

'11: TEXT type must only contain numbers and "-"

'12: must be the TEXT type for the correct URL

'13: Must be less than the TEXT type of the specified bit

'14: Do not contain the TEXT type of HTML tag

'15: Confirm that the unwanted SELECT type must be selected: Check Table Items | 15 | Tips Information | Association

'Note: If you have a cascade menu, please put the verification process of the cascade menu in the final inspection! ! ! !

'------------------------------------- ----------------------------

%>

<%

Sub Checkform_JS (FRMNAME, ERRSTR)

DIM TMPARR

DIM I

DIM strshow 'String of JS

'Get the wrong list, build an array

TMPARR = Split (Errstr, ",")

'Write JS

For i = 0 to Ubound (TMPARR)

I <> 0 THENSTRSHOW = strshow & "else" & findjs (frmname, tmparr (i))

Else

STRSHOW = strshow & findjs (frmname, Tmparr (i))

END IF

NEXT

'Output

strshow = "