I'm back :)
So, I use a form generate by ajax request like this:
PHP file:
if($type=='BLOB' and $type_form=='text')
{
echo '<textarea class="ckeditor" id="'.$nom.'" name="'.$nom.'">';
echo $donnees[$i];
echo '</textarea>';
}
JS file:
function form(table,id)
{
div_sup();
instance_ajax('http'),
http.open("GET", '../php/form.php?table='+table+'&id='+id, false);
http.send(null);
document.getElementById('fondnoir').style.display='block';
document.getElementById('fond_contenu2').innerHTML=http.responseText;
}
And generated file:
<form action="../php/traitement.php?table=content&id=4" method="POST" name="affiche_grille">
<input type="hidden" id="ID_CONTENT" name="ID_CONTENT" value="4">
<label>Page:</label>
<input type="text" id="PAG_CON" name="PAG_CON" value="protu"><br><label>Image:</label>
<input type="text" id="IMG_CON" name="IMG_CON" value="bxcb"><br><label>Titre FR:</label>
<input type="text" id="TFR_CON" name="TFR_CON" value="xcbxcb"><br><label>Description FR:</label>
<textarea class="ckeditor" id="DFR_CON" name="DFR_CON">xcbxc</textarea><br><label>Contenu FR:</label>
<textarea class="ckeditor" id="CFR_CON" name="CFR_CON">bxcbxcbx</textarea><br><label>Keywords FR:</label>
<textarea class="ckeditor" id="MFK_CON" name="MFK_CON">cbxc</textarea><br>etc..
<input type="submit" id="c_submit" name="c_submit" value="Valider"></form>
Normally, all textarea should be replaced by ckeditor ? I use class="ckeditor"... And with a single html or php, it work good but with this ajax code, nothing is replaced.
What's the problem ?
Nobody ? :(
Nobody ? :(
UP, please help :/
UP, please help :/
no way
no way
To initialize editor on
To initialize editor on dynamically created textareas you need to use either CKEDITOR.replaceAll() or CKEDITOR.replace( textarea_id ). But remember that you need to destroy all old instances first using editor.destroy() method.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Ok thank you :)
Ok thank you :)
Last question: where must add this code ?
Ok, I'm back one month later.
Ok, I'm back one month later.
Where I must place the code ?
I tried this but don't work:
keep on you will find one