problem using tinymce

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tokcy
    New Member
    • Sep 2008
    • 45

    problem using tinymce

    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...
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Could you post a link or some code.

    Comment

    • tokcy
      New Member
      • Sep 2008
      • 45

      #3
      here is code for tine mce
      Code:
      <!-- TinyMCE -->
      <script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
      <script type="text/javascript">
          tinyMCE.init({
          
              // General options
              mode : "textareas",
              theme : "simple",
              content_css : "tinymce/css/word.css",
      
              // Drop lists for link/image/media/template dialogs
              template_external_list_url : "tinymce/lists/template_list.js",
              external_link_list_url : "tinymce/lists/link_list.js",
              external_image_list_url : "tinymce/lists/image_list.js",
              media_external_list_url : "tinymce/lists/media_list.js",
      
              // Replace values for the template plugin
              template_replace_values : {
                  username : "Some User",
                  staffid : "991234"
              }
          });
      </script>
      <form>
      <textarea id="description" name="description" rows="10" cols="50" style="width:300px"><?=$str1?>
      </textarea>
      </form>
      
      on another page 
      <div id="showallcat"></div>
      in the same page
      onclick of edit section i am calling div using ajax in this page i want to embed tinymce.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Dealing with the second problem first: you need to eval the JavaScript or include it within the calling page.

        Comment

        • tokcy
          New Member
          • Sep 2008
          • 45

          #5
          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.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            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.

            Comment

            • tokcy
              New Member
              • Sep 2008
              • 45

              #7
              Code:
              function showadd(str,str1,str2,str3)
              {
                  document.getElementById('showallcat').style.display='block';
                  displaydiv(str,str1,str2,str3);
              }
              function closediv()
              {
              document.getElementById('showallcat').style.display='none';
              }
              
              
              function displaydiv(str,str1,str2,str3)
              { 
                  xmlHttp=GetXmlHttpObject()
                  var url=str
                  //alert(str1);
                  //alert(xmlHttp.responseText );
                  url=url+"?id="+str1+"&mid="+str2+"&ssid="+str3
                  //alert(url);
                  url=url+"&sid="+Math.random()
                  xmlHttp.onreadystatechange=stateChanged 
                  xmlHttp.open("GET",url,true)
                  xmlHttp.send(null)
              }
              function stateChanged() 
              { 
              
              if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
               {
               document.getElementById("showallcat").innerHTML=xmlHttp.responseText
               } 
              }
              function GetXmlHttpObject()
              {
              var xmlHttp=null;
              try
               {
               // Firefox, Opera 8.0+, Safari
               xmlHttp=new XMLHttpRequest();
               }
              catch (e)
               {
               //Internet Explorer
               try
                {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
                }
               catch (e)
                {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
               }
              return xmlHttp;
              }

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                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.

                Comment

                Working...