Added javascript for form validation