Refactor validation.js
Add to the index.html
Refactor validation and implement.