Are textareas not editable with enter key?
Are textareas not editable with enter key?
IsaacBen
Posts: 35Questions: 8Answers: 4
I have a textarea field that on enter key inserts a line break, but I would like it to submit the edit instead. How can I do that?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This seems to do the job, but it's not as smooth and it doesn't show the loader icon. Hope there is a better way.
Okay, solved it. To make it function as a regular input inline edit I had to remove two lines from above.
Works perfect now. Would still like to know if there is a builtin way to do this.
The final option is the way to do this. There isn't a built in option for this since a return is typically perfectly valid in a textarea. Field's which don't need or allow a return would use a simple
text
input field. I realise that isn't always the case and if you have large amounts of text without a return you'd run into what you have, but typically that is what I have found to be the case.Editor 1.6 now has a new option in its field plug-ins to allow the plug-in to say if the return key should submit or not (
canReturnSubmit
). So perhaps the cleanest way would be to have a plug-in that uses atextarea
but will use that option to allow return to submit.Regards,
Allan