optimized toggleInput