I am including the following function to create the FCKEditor box in a form. The function is part of a class, and the entire form is displayed later when $this->form_content is echoed by a display function.
The problem is that the FCKEditor is appearing as soon as the object is created and therefore appears in the html above the form, rather than appearing in the proper location when the form is created and displayed.
Is anyone able to please help me?
Thanks,
Adam
function fckeditor($field_id,$text='',$required="0") {
include_once(INCLUDE_PATH."/FCKeditor/fckeditor.php");
$form_field="<tr><td><label for=\"$field_id\" class=\"$class_l\">".constant(strtoupper($field_id))."$star:</label></td>";
$form_field.="<td>";
$this->oFCKeditor = new FCKeditor($field_id);
$this->oFCKeditor->BasePath = "/private/includes/FCKeditor/";
$form_field.=$this->oFCKeditor->Create();
$form_field.="</td></tr>\n";
$this->form_content.=$form_field;
return;
}
The problem is that the FCKEditor is appearing as soon as the object is created and therefore appears in the html above the form, rather than appearing in the proper location when the form is created and displayed.
Is anyone able to please help me?
Thanks,
Adam
function fckeditor($field_id,$text='',$required="0") {
include_once(INCLUDE_PATH."/FCKeditor/fckeditor.php");
$form_field="<tr><td><label for=\"$field_id\" class=\"$class_l\">".constant(strtoupper($field_id))."$star:</label></td>";
$form_field.="<td>";
$this->oFCKeditor = new FCKeditor($field_id);
$this->oFCKeditor->BasePath = "/private/includes/FCKeditor/";
$form_field.=$this->oFCKeditor->Create();
$form_field.="</td></tr>\n";
$this->form_content.=$form_field;
return;
}
RE: FCKEditor appears outside of form object
the PHP funcs you'll need to work with start with "ob_", such as: ob_start(), ob_get_contents(), etc. check the php manual for more info, but your code would look something like:
...
$this->oFCKeditor->BasePath = "/private/includes/FCKeditor/";
ob_start();
$this->oFCKeditor->Create();
$form_field = ob_get_contents();
ob_end_clean();
...etc...
i hope this nudges you in the right direction...
RE: FCKEditor appears outside of form object
example:
$this->oFCKeditor->BasePath = "/private/includes/FCKeditor/";
$form_field = $this->oFCKeditor->CreateHtml();
RE: FCKEditor appears outside of form object
hey, that's good to know
RE: FCKEditor appears outside of form object
- Adam