Hi guys
Does anyone know how to dynamically transform a normal textarea into a FCKeditor instance just with a Javascript link/button such as <a href="javascript:make_fckinstance()">Rich text edition</a> ?
Thanks !
Thu, 06/28/2007 - 07:22
#1
RE: textarea to FCK instance without page rel
Case closed!
Here is how I did :
...
<script type="text/javascript" src="../../../_dir_php_classes_/fckeditor/fckeditor.js"></script>
...
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
function temp_4_fckmake(form_name, div_elem_name, width, height) {
var div = document.getElementById(div_elem_name);
var oFCKeditor = new FCKeditor(div_elem_name);
oFCKeditor.BasePath = "../../../_dir_php_classes_/fckeditor/";
oFCKeditor.Value = document.forms[form_name][div_elem_name].value;
oFCKeditor.Width = width;
oFCKeditor.Height = height;
oFCKeditor.ToolbarSet = 'Basic';
oFCKeditor.Config['DefaultLanguage'] = "fr";
div.innerHTML = oFCKeditor.CreateHtml();
div.style.padding = '5px 0px 5px 0px';
}
// End -->
</SCRIPT>
...
<div id="form_type_desc_2" align="right">
<textarea name="form_type_desc_2" class="textarea2"></textarea>
<br />
<a href="javascript:
temp_4_fckmake(
'form_04',
'form_type_desc_2',
'100%',
200)" class="cssa1">[ Edition avancée ]</a>
</div>
...