PDA

View Full Version : Basic HTML text editor???



TandemAdam
September 4th, 2007, 07:38 PM
Hi guys. Does anybody know how I would go about building a textarea with some basic formating in HTML (with Javascript or whatever)?

All I want to have, is a basic Textarea with some very basic formating buttons, eg. BOLD, ITAlIC, and UNDERLINE. Thats it!
:}

The textarea will be used in the backend of my site so the client can update the content themselves. I have used FCKeditor before but the client seemed to have too much control, and it screwed up my great design with ugly formated text. And the code output was horible. Filled with FONT tags, and other unwanted HTML formating, that conflicted with my stylesheets.

Can anyone explain how to do this, or point me to another post, or a tutorial?

Thanks heaps,
TandemAdam

Zaid_W1red
September 4th, 2007, 08:32 PM
http://www.tufat.com/s_flasharea_wysiwyg_editor.htm

This is flash based but workes awesome as part of an html/php/mysql cms ...you dont really need the payed version as you wouldnt need the source code ...evn though it only $5 ;)

simplistik
September 5th, 2007, 12:08 AM
The textarea will be used in the backend of my site so the client can update the content themselves. I have used FCKeditor before but the client seemed to have too much control, and it screwed up my great design with ugly formated text. And the code output was horible. Filled with FONT tags, and other unwanted HTML formating, that conflicted with my stylesheets.
We use FCK but we still post process their input. We run a
$str = strip_tags($str,'<p><strong><em><ul><li><h1><h2><h3>');then we run it through a custom new line to paragraph function (which you can google for one) which what we do is process the $var into it.

Just cause you're giving them control over it doesn't mean you can't still force structure on them a bit. The client wont' know the difference, most of the time they just copy and paste, which is where the trouble comes in. Also, note that you can limit the FCK toolbar, so if you're giving them a full toolbar to play with to begin with, then don't blame the client... blame yourself.