validation and input type changed