Francesco
Francesco

Reputation: 149

Send form on enter key press with select2

I've a form with a select2 element (remote data example: https://select2.github.io/examples.html). I would like to send the form on enter key press in order to send the custom typed text without selecting a choice from the dropdown list. Is it possible?

Please see the attached image as example: I would like that, pressing enter key, the typed terms "text not present on the dropdown list" will be sended on the form.

Thanks

Example

Upvotes: 3

Views: 5517

Answers (1)

Sherif Ahmed
Sherif Ahmed

Reputation: 1946

I faced the same and found the solution on the below link

onKeyEnterSelect2.js

because the author of the plugin ... kills the event in case of enter click..

check the issue here Triggering submit with enter

Upvotes: 2

Related Questions