Smart form submit action. Prevent enter key to submit directly.