Image

Imagesoltice wrote in Imagewebdev

Visual Text Formatting with Javascript

One thing that is disappointing -- to me at least -- with form fields is their utter lack of visual formatting. You have to resort to HTML or custom codes to do a simple thing like bolding text. In virtually all other applications a user sees, such a thing would be done by clicking a Bold button above the text field.

One way to solve this problem would be to embed a java applet for text input. This would require greater programming, but that's not the only problem. Java doesn't work all that well for a critical element: There are crashing problems, the load time can be annoying.

I would rather opt for Javascript instead. I've seen scripts that can trap keypresses as the user types them without a form field. And I've seen examples that can insert text into a webpage on the fly. Why not combine the two. With a little extra programming, the text formatting state can be set via clickable images. These images can insert HTML into the text area (probably just a blank table cell) instead of plain text.

Has anyone else come up with this idea before?  Is it just not worth the effort?