Trim input before validate.