据说CSDN就是用的FCKeditor,请教一下简单问题,设置输入框中的初始值是如何设置的呢??

解决方案 »

  1.   

    <html>
    <head>
    <title>FCKeditor的应用</title>
    </head>
    <body>
    <?php
    echo $_POST["fckeditor1"];
    ?>
    <h2>FCKeditor的应用</h2>
    <script type="text/javascript" src="./FCKeditor/fckeditor.js"></script>
    <form name="form1" action="<?= $_SERVER["PHP_SELF"]?>" method="post">
    <script language="javascript">
    function cj(){
    var oFCKeditor = new FCKeditor( 'fckeditor1' ) ;
    oFCKeditor.BasePath = "./fckeditor/" ;
    oFCKeditor.Height = 200 ;
    oFCKeditor.ToolbarSet = "Default";
    oFCKeditor.ReplaceTextarea("111111") ;
    }
    </script>
    <textarea name="fckeditor1" type="hidden" style="display:none;"></textarea>
    <input type="button" value="编辑文章" name="bianji" onclick="cj();document.form1.bianji.disabled=true;" />
    <input type="submit" value="提交文章" />
    </form>
    </body>
    </html>
      

  2.   

    知道了,php的调用方式如下
    <?php    
    //包含fckeditor类    
    include("fckeditor/fckeditor.php") ;    
    //创建一个FCKeditor,表单名称为 jzleditor    
    $oFCKeditor = new FCKeditor("jzleditor");    
    //设置编辑器路径    
    $oFCKeditor->BasePath = "fckeditor/";    
    $oFCKeditor->ToolbarSet = "Default";//工具按钮    
    $oFCKeditor->Value =$cont;  //;设置初始内容    
    $oFCKeditor->Width="100%";  //设置它的宽度    
    $oFCKeditor->Height="550px";  //设置它的高度    
    $oFCKeditor->Create();    
    ?>