Black Friday: Save up to 65% on DMXzone with DMXBF26 and 30% on Wappler yearly plans with WAPPLERBF26. Ends 30 November!

Validating Forms: A JavaScript Validation Class

We build a main validation function that automatically runs the right "sub" function for each field. We'll tell the main function which sub function to run by including the sub function name in the element ID and extracting it. This makes an abstract function that can be placed in any file. Then what you actually put in the tags determines the validation.

You won't have to necessarily edit the main function all the time, which is the part that can become really tedious and error-prone, and can be reused again and again.

$2.89
- OR -

Overview

Table of Content:

  • Validation: Have a Strategy
  • A Validation Library
    • What is a Regular Expression?
    • How We'll Build It
    • A Word About Validation Techniques
    • Empty Fields
    • The Form
    • The isEmpty() Function
  • Conclusion

Reviews

Be the first to write a review

You must me logged in to write a review.