chat example: use .on instead of submit