form validation update

corrected the JS validation