How to create/use Joomla! editor? JFactory::getEditor()

Example (short version in J!3.x)

$default_value = JFactory::getApplication()->input->get('your_field_name','');
$editor = JFactory::getConfig()->get('editor');
$editor = JEditor::getInstance($editor);
echo $editor->display( 'your_field_name', $default_value, 250, 250, 20, 20);

In Joomla! 2.5 the parameters list for the display() function has been lengthened, so to use specific display parameters in 2.5:

$editor =& JFactory::getEditor();
$params = array( 'smilies'=> '0' , 'style'  => '1' , 'layer'  => '0' , 'table'  => '0' ,'clear_entities'=>'0' );
echo $editor->display( 'desc', '', '400', '400', '20', '20', false, null, null, null, $params );

Allow html code in JRequest

Parameter in XML form structure field for allowing HTML tags

When you are using XML form structure you can use editor form field type.
In that case for allowing HTML tags you have to use the attribute:

filter=’safehtml’

to allow saving the content with html tags.
Example ↓

<field
name="field_desc"
type="editor"
filter="safehtml"
width="350"
height="80"
label="COM_YOURCOMPONENT_EDITOR_FIELD_LABEL"
description="COM_YOURCOMPONENT_EDITOR_FIELD_DESC"
cols="20"
rows="3"
class=""
default=""
/>

Continue reading Parameter in XML form structure field for allowing HTML tags