Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text area format editing

Status
Not open for further replies.

ryanbrand

Programmer
Oct 28, 2003
22
US
Hi,
I'm creating a form with a text area. I would like my users to to be able to format their text (bold, italics, color, font).
Then I would like the text and formating to be saved into a DB. Then be displayed with the formatting.

Is there any code that can let my users (non-coders) format their text areas so that can be saved in a database and then can be displayed.

I can do some formatting with CSS, but I don't know how I could let the user choose the formatting and then save it in a DB.

.textarea {
font-family : serif;
color : Aqua;
}

Thank you for your help!!
Ryan
 
Ryan, you need to insert an a WYSIWYG editor control in your form. There are many free controls out there. The problem is most of them are built around the MSHTML control built-into IE. This control creates &quot;dirty&quot; code and uses deprecated tags like <font> or inline formatting like style=&quot;font-family:arial&quot; which is just as bad. There is a free XHTML control from that generates pretty decent code.

Good luck.
 

Ryan,

You could also get away without using a control, if your target audience is only using IE. I can't remember the exact property name (maybe someone else can help out here), but it's somethinglike &quot;documentEditable&quot;... and when set to &quot;true&quot;, it lets you edit an HTML document on-the-fly.

This is how the 'rich text' message edit box in Hotmail works - basically it's an HTML page which you edit directly in the browser, and thus can insert markup to change the font style, colour, etc.

Hope this helps,

Dan
 
Thanks for your information. I think I want to stay away from having tags inside the text box, so I'm going to try the Xstandard and see if that suits my needs.

Thanks again for your ideas!

Ryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top