ASP dynamically generated JavaScript form verification code

xiaoxiao2021-03-06  60

In the Internet Down, an ASP dynamically generates FORM verification JavaScript code, which expands it. I have forgotten the author's big name, but I remember that the code from the first to ninth is the author's original. As for nine to 15th, it is my own. And because the level of this is limited, from article 9 to 15th, it is not necessarily taken into force. Oh, actually put it there is nothing necessary, because this small will be used, I will position it as: I can't find this function when I have been developed. You can copy it. Oh, because I don't have a recorder, there is no mobile hard disk. There is no way to carry these code with you, but it is ok, you can go online everywhere in Beijing. So putting this here, when Ctrl C is used, then Ctrl V is good.

<% '****************************************************** ****************** '' Function Name: Checkform_JS (FRMNAME, Errstr) 'Function: Dynamically write the function of JavaScript's form verification with ASP CHECKSUBMIT () " 'Usage: 1, ;' '2,

;' The original author has been forced, secondary development author: Guo.Q.M '' last updated: 2004 '' *********************************** *****************************''help:''--------------- ------------------------------------------------ '' · Parameter description: '' frmname: The name of the form "'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 form field name, 3 indicates the verification parameters, 8 indicates the number of bits (optional) '' '· verification parameter list:' '0: Required TEXT type' 1: Required ListMenu type ' '2: The TEXT type "3: must be the TEXT type" 4: must be greater than the TEXT type of the specified bit "' 5: must be an email TEXT type '6: must be AZ Or 0-9 character's text type '' 7: Confirm password and password must be equal with TEXT type '' '' '' 8: Confirm not to start with the TEXT type '' '9: must contain TEXT Type "" 10: Do not contain the text type of Chinese, space, and other illegal characters, that is, only "_" "" 0-9 "AZ" az "'11: must only contain numbers and" - " TEXT Type '' 12: The text type "" must be smaller than the TEXT type "of the specified bit" must be smaller than the TEXT type "of the HTML tag," confirmed that the unwanted SELECT type must be selected : Checking the form | 15 | Tip Information | Association item "'' Note: If there is a cascade menu, please put the verification process of the cascade menu in the final inspection! ! ! ! '' ------------------------------------------------ ------------------------%> <% SUB CHECKFORM_JS (FRMNAME, Errstr) DIM TMPARRDIM IDIM STRSHOW 'output JS string' get an error List, build array TMPARR = Split (Errstr, ",") ''

Write JS for i = 0 to Ubound (tmparr) if i <> 0 Then strshow = strshow & "else" & findjs (frmname, tmparr (i)) Else strshow = strshow & findjs (frmname, tmparr (i)) end if next '' output strShow = "