I’m using TinyMCE to edit a Ajax loaded form. When I post the form with plain text then it comes on database. But when I try to style the texts (eg: Bold, Italic, etc), It not arrives also no mysql_error() generates. I’m using the below code to post the data to database (I tried using three method but any of the below not worked for me)
1) stripslashes($_POST['msg'])
2)
$allowedTags='<p><strong><em><u><h1><h2><h3><h4><h5><h6><img>';
$allowedTags.='<li><ol><ul><span><div><br><ins><del>';
strip_tags($_POST['msg'], $allowedTags)
3) htmlentities($_POST['msg'])
and then I tried var_dump($_POST[‘msg’]) and it showed string(“0”);
then I removed tinyMCE javascript link, now it works fine. I couldn’t understood what may be the problem ?
my TinyMCE integration code:
<script type="text/javascript" src="najupal.com/home/js/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced"
});
</script>
please help me .
So i guess your text from texarea is not passed to the script if i understand this right?
I remember that i have such a problem a while ago using both ajax (xajax and TinyMCE)
Try to add this code into a button before any other function:
In Xajax for example this is how it should look:
So try to call tinyMCE.triggerSave(false, false); function before posting data.
Hope i undertand this right and this will solve your problem.