textarea
textarea
Highlight The Contents Of A Textarea With JavaScript
Wed, 08/27/2008 - 08:47 | by philipnorton42If you want to give your users a little snippet of code it is nice to give them the option of selecting the entire block of code without having to highlight the text manually. This can be done with a simple JavaScript button.
Take the following form:
Enabling Tabbing In A Textarea
Fri, 06/20/2008 - 08:42 | by philipnorton42When a user presses the tab key in a browser window the normal action is for the user to move the focus to a different control. To enable a word processor like tab effect in a text area you need to catch the keystroke and add in the tab character to where ever the cursor is. This is the main issue with creating this solution, it is easy to add a tab to the end of the text, but most users might want to add a tab half way through the text.
Take the following HTML text area.