put validation code to form.js