Keep valid values for text field and textbox