JavaScript for input boxes. Hide fallback input when not required etc