Text input validation working for both fields