fixes form validation with JavaScript. TODO: Stylistic finishing touches and prevent element hiding on window resizing