By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,702 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,702 IT Pros & Developers. It's quick & easy.

problem using tinymce

P: 45
hi everyone,

i have used tinymce editor in my project, but i have some problem like whenever i am selecting data from database and when i want to wiew the details of that particular section then it showing including the tinymce editor TAGS that i doo not want i mean when somebody want to view the details then it should show only normal font not TAGS of editor.

and one more problem i am opening a DIV on click of link using AJAX and i want tinymce editor in that DIV which is for edit but it not showing editor it showing only normal TEXTAREA. how can i embed tinymce in TEXTAREA of DIV while i am using AJAX.
please help me

thanx to all...
Jan 30 '09 #1
Share this Question
Share on Google+
7 Replies


acoder
Expert Mod 15k+
P: 16,027
Could you post a link or some code.
Jan 31 '09 #2

P: 45
here is code for tine mce
Expand|Select|Wrap|Line Numbers
  1. <!-- TinyMCE -->
  2. <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
  3. <script type="text/javascript">
  4.     tinyMCE.init({
  5.  
  6.         // General options
  7.         mode : "textareas",
  8.         theme : "simple",
  9.         content_css : "tinymce/css/word.css",
  10.  
  11.         // Drop lists for link/image/media/template dialogs
  12.         template_external_list_url : "tinymce/lists/template_list.js",
  13.         external_link_list_url : "tinymce/lists/link_list.js",
  14.         external_image_list_url : "tinymce/lists/image_list.js",
  15.         media_external_list_url : "tinymce/lists/media_list.js",
  16.  
  17.         // Replace values for the template plugin
  18.         template_replace_values : {
  19.             username : "Some User",
  20.             staffid : "991234"
  21.         }
  22.     });
  23. </script>
  24. <form>
  25. <textarea id="description" name="description" rows="10" cols="50" style="width:300px"><?=$str1?>
  26. </textarea>
  27. </form>
  28.  
  29. on another page 
  30. <div id="showallcat"></div>
  31. in the same page
  32. onclick of edit section i am calling div using ajax in this page i want to embed tinymce.
  33.  
Feb 1 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Dealing with the second problem first: you need to eval the JavaScript or include it within the calling page.
Feb 1 '09 #4

P: 45
I have solve the first problem but still i am chasing second problem and according to you i need to include within calling page so i am doing the same but my prob is still there.
Feb 2 '09 #5

acoder
Expert Mod 15k+
P: 16,027
By the calling page, I mean the page where the Ajax request is made, not the page being requested.

Can you show all of the relevant Ajax/page code.
Feb 2 '09 #6

P: 45
Expand|Select|Wrap|Line Numbers
  1. function showadd(str,str1,str2,str3)
  2. {
  3.     document.getElementById('showallcat').style.display='block';
  4.     displaydiv(str,str1,str2,str3);
  5. }
  6. function closediv()
  7. {
  8. document.getElementById('showallcat').style.display='none';
  9. }
  10.  
  11.  
  12. function displaydiv(str,str1,str2,str3)
  13.     xmlHttp=GetXmlHttpObject()
  14.     var url=str
  15.     //alert(str1);
  16.     //alert(xmlHttp.responseText );
  17.     url=url+"?id="+str1+"&mid="+str2+"&ssid="+str3
  18.     //alert(url);
  19.     url=url+"&sid="+Math.random()
  20.     xmlHttp.onreadystatechange=stateChanged 
  21.     xmlHttp.open("GET",url,true)
  22.     xmlHttp.send(null)
  23. }
  24. function stateChanged() 
  25.  
  26. if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
  27.  {
  28.  document.getElementById("showallcat").innerHTML=xmlHttp.responseText
  29.  } 
  30. }
  31. function GetXmlHttpObject()
  32. {
  33. var xmlHttp=null;
  34. try
  35.  {
  36.  // Firefox, Opera 8.0+, Safari
  37.  xmlHttp=new XMLHttpRequest();
  38.  }
  39. catch (e)
  40.  {
  41.  //Internet Explorer
  42.  try
  43.   {
  44.   xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  45.   }
  46.  catch (e)
  47.   {
  48.   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  49.   }
  50.  }
  51. return xmlHttp;
  52. }
  53.  
  54.  
Feb 3 '09 #7

acoder
Expert Mod 15k+
P: 16,027
Is the TinyMCE code in the URL that's passed to this Ajax function? If it is, the JavaScript code will need to be evaled. Any script tags will need to be included in the parent page too.

What I would suggest is to separate the content, so you have HTML and JavaScript separate and then you can deal with them appropriately.
Feb 3 '09 #8

Post your reply

Sign in to post your reply or Sign up for a free account.