refactor validate.js
add valid feature to register page