A powerful form verification program

xiaoxiao2021-03-06  41

The verification of forms has always been a problem of headaches in web designers. The form verification class Validator is written to solve this problem, which is designed to liberate the designer from a complex form verification, focusing on the design and function of the webpage. Improvement. Validator is a custom property based on JavaScript technology's pseudo-static category and objects, which allows table items in the web page to verify, allowing the same page to simultaneously verify multiple forms, familiar with the interface, can also make specific forms or even Just a certain string verification. Because it is a pseudo-static class, it is called when the call is called, directly in "class name . Syntax attribute or method name". In addition, Validator also provides three different error prompt modes to meet different needs.

Validator currently implemented authentication types: 1. Whether it is empty; 2. Chinese characters; 3. Double-byte characters 4. English; 5. Number; 6. Integer; 7. Implement; 8.Email address; 9. Use URL of the HTTP protocol; 10. Telephone number; 11. Currency; 12. Mobile number; 13. Postal code; 14. ID number; 15.QQ number; 16. Date; The repetition value of the item; 19. Two numbers are compared; 20. Judgment the input value is in the (n, m) interval; 21. Enter the character length limit (can be compared by byte); 22. For radicals with the same name The selection of buttons is determined; 23. Restrict the number of selection of multi-selection buttons with the same name; 24. Customized regular expression verification; Run Environment (client): use IE6.0 SP1 and Mozilla Firefox in Windows Server 2003 1.0 test pass; Netscape test under Lunix Redhat 9 passed; Validator complete code: