move form validation javascript to separate file