What Are Form Validation and Sanitization?

When creating web forms and processing them with Node, it is essential to validate and sanitize all user generated content. Proper validation and sanitization will keep your form user-friendly and secure. They help protect against common approaches to hacking like XSS attacks (Cross-site scripting) and SQL injection, amongst other things. It will also help prevent your application from malfunctioning when trying to process safe but unexpected input.

In this tutorial we'll:

  • Learn about form input validation for Node.js
  • Learn about sanitizing user generated content
  • Explain why validation is essential for functionality and usability
  • Explain why sanitization is crucial for security

By the end of this tutorial, you will understand the consequences of not validating and sanitizing user input and why it's important.

This tutorial is part 2 of 7 tutorials that walk through using Express.js for user authentication.

Log in or Sign up to view the complete tutorial.

Sign in with your Osio Labs account
to gain instant access to our entire library.

Data Brokering with Node.js