Added validation of form values to javascript file