Check input change and prevent submit with whitespace