ASP dynamically generated JavaScript form verification code

xiaoxiao2021-03-06  65

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.

<% '******************************************************* ************************************ The name: Checkform_JS (FRMNAME, Errstr) "function: dynamically write with ASP) JavaScript's form verification function checksubmit () 'Usage: 1, ;' 2,

; 'Original author has been forgotten, the secondary development of: 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 parameter, 8 indicates the number of bits (optional)' ' · Verification Parameter List: '0: Required Text Type' 1: Required ListMenu Type '2: Must for the TEXT Type' 3: Must for the TEXT Type of the specified bit number '4: must be greater than the specified number TEXT Type '5: Must for Email's Text Type' 6: TEXT Type of AZ or 0-9 characters '7: Confirm Password and Password must be equal to TEXT type' 8: Confirm not to start with a TEXT type '9: You must include TEXT type '10 in 10-888888: Do not contain text types of Chinese, spaces, and other illegal characters, that is, only "_" "-" "0-9" "AZ" az "'11 : You must only contain numbers and "-" '12: TEXT type '13 must be the correct URL '13: must be less than the TEXT type of the specified bit "114: Do not include the HTML tag text type '15: confirmation The disabled SELECT type must be selected: Table Items | 15 | Tips | Association items "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 TMPARRDIM IDIM STRSHOW 'Output JS String' Get the wrong list, build an 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 = "