How to get value fro fck editor to parent text box ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shalini Bhalla
    New Member
    • Dec 2007
    • 190

    How to get value fro fck editor to parent text box ?

    following is the code of my fckeditor , i want to get the text witten in editor in textbox of its parent winow how to do that ?



    Code:
    <script>
    function show_cal()
    {
    
    alert(document.pop_form.FCKeditor1.value);
    
    }
    
    </script>
    <?
    include("fckeditor/fckeditor.php") ;
    echo"<form name='pop_form'>"; 
    		 
    		 $sBasePath = $_SERVER['PHP_SELF'] ;
    		 $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "admin" ) ) ;
    
    		$oFCKeditor = new FCKeditor('FCKeditor1') ;
    		$oFCKeditor->BasePath	= $sBasePath."admin/fckeditor/" ;
    		//	$oFCKeditor->BasePath	= "/user/htdocs/workflow/admin/fckeditor/" ;
    		$oFCKeditor->Value		= 'sasas';
    
    
    
     $oFCKeditor->Create() ;
    
    echo"<input type='button' name='close' value='close' onclick='show_cal();self.close();'>";
    
    		
    echo "</form>";
    
    ?>
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    You would have to make a call the the Javascript API to do that

    Code:
    var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
    var text = oEditor.GetHTML(true);
    The Javascript API is slightly documented here.

    Comment

    Working...