In this code I will show you how to implement validation in Client and Server side using express-validator and JQuery Validation. It is an small project that demonstrate the validation on a form. If this code helped you to solve your problem, please help with a coffee. Thanks.
Remember to make npm i or npm install in the root of the app to install the modules.
- index.js -> Our app server.
- public -> Static files (CSS, JS, IMGS).
- js
- validation.js -> Our script to validate with JQUERY VALIDATION
- js
- app -> routes and views
- routes
- home.js
- views
- home.html
- routes
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
"express-session": "^1.15.6",
"express-validator": "^5.2.0",
"hbs": "^4.0.1"
}