Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override TAB inside a Browser

If I'm typing text in a input field and press ENTER the default behavior of all the browsers I know is to submit the form, however if I press ENTER inside a textarea a new line is added.

Is there any way to mimic this behavior (indent, not submit the form) whenever I press TAB inside a textarea? Bespin seems to do it, but in a canvas element.

like image 375
Alix Axel Avatar asked May 15 '26 12:05

Alix Axel


1 Answers

I haven't done it myself, but it seems to be possible to override the event handler and catch the key. See e.g. here.

Oh and for the JQuery crowd there even is a plugin.

like image 55
Pekka Avatar answered May 18 '26 03:05

Pekka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!