Keyboard dynamic actions fo create a new line and submit

I have a text-area in a form and the user can add in text and hit enter and add a new line.

I want to be able to change this key behavior so that the user has to hit “Shift + Enter” to create a new line and when they hit “Enter” it submits the form.

I have played around with the Key-press option and tried different modifiers to get it to submit only when you hit the enter key, submitting the form is not an issue, but I can’t stop it submitting even when using the combination “Shift + Enter” it still want to submit.

Is there a way to do this ?

So I want to create a new line when using the keys “Shift + Enter” and submit only when using “Enter”?

Thanks!

If I place a textarea in a form it creates a new line when hitting enter or shift+enter, neither submit the form.
If I am not mistaken this is because mobile devices do not really have a shift+enter in the conventional way a desktop has.
May be a bad idea to alter it, normal text inputs do submit the entire form with enter or shift+enter, but a text area seems to disable both.

2 Likes

Hmmmm :thinking: yes that’s a good point considering a good proportion will be accessing via a mobile device.

Thanks. Will rethink this!