Discussion Locked

Text formatting from web broswer...

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am looking for a component or script that I can put on my web pages that would allow the website user to type in text in a textbox and then highlight it and make it as bold, italic, etc. These users would not have to know that wrapping 'b' and '/b' around a word or phase would make it bold.

2 replies

by jay eckles

The problem with what you're trying to do is that I don't think you can format text within a textarea (well, at least not portions of the text - it's an all-or-nothing proposition). What I think I would do is either find/create a Java Applet to do what you want - which should be hard - or add buttons for bold, italic, etc. below the text area, and when clicked will add the appropriate HTML around the selected text via Javascript. The user doesn't have to know , but the user will see those tags in the textarea.

Good luck.

Jay

by mark

Try using the "CONTENTEDITABLE" attribute of something like a

element:

Example:


Some Sample Text

Now, when you preview this in your webbrowser, you will be able to 'edit' the text, and make a section of it bold (hi-lite it and hit Ctrl+B) etc

I think this is the solution you're looking for, and will avoid the need for any Applets!

Regards,
Mark Harrington
Creator, The WebWizard HTML Editor
http://www.the-webwizard.co.uk/

This discussion is closed to new replies.