Reputation: 1364
I have this form where it submits by pressing enter key.
I want it to function except for textarea, where it should has it usual behavior adding a new line in text-area
Upvotes: 0
Views: 413
Reputation: 1038710
The default behavior is that the form doesn't submit if you press enter inside a textarea as seen in the following live demo. It simply adds a new row inside the textarea. You don't need any javascript for this. On the other hand if the the user presses enter while inside a normal textbox the form is submitted.
Upvotes: 1