Basic framework for js form validation