Make external js for form validation reusable.