Fixing JS rules for Showing and hidding the field input box