validates inputs on keyup