Create validator.js

adding validator js file