<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script src='/fckeditor/fckeditor.js' type="text/javascript"></script>
<script type="text/javascript" src="/js/company.js"></script>
</head>
<body>
<div class="main-block">
<h2>业务新闻</h2>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ffffff">
        <form name=memberform action="" method="POST" ENCTYPE="multipart/form-data">
          <input type="hidden" name="f" value="<{if $id}>change_news_info<{else}>creat_news<{/if}>">
          <input type=hidden name=id value="<{$id}>">
          <tr>
            <td bgcolor="#f9f9f9">
              <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D9D9D9">
               <tr>
                 <td bgcolor="#FFFFFF"><table width=100% border=0 align="center" cellpadding=1 cellspacing=2 class="black">
                  <tr bgcolor="EFF7FF" class="t14" >
                     <td bgcolor="#f9f9f9" class="t14"><div align="right" class=txt>类型:</div></td>
                     <td bgcolor="#F9F9F9" class="t14">
                       <select name="sort">
                           <option value="0">业务动态</option>
                           <option value="1">最新优惠</option>
                       </select>
                      </td>
                   </tr>
                   <tr bgcolor="EFF7FF" class="t14" >
                     <td bgcolor="#f9f9f9" class="t14"><div align="right" class=txt>标题:</div></td>
                     <td bgcolor="#F9F9F9" class="t14">
                      <input name="title" value="<{$title}>"></td>
                   </tr>
                   
                   <tr bgcolor="#EFF7FF" class="t14">
                     <td align=right bgcolor="#f9f9f9" class=t14>
                      内容: <br>
                     <td>
       <textarea id="content" name="content" cols='70' rows='12' ><{$content}>
        </textarea>
    
                  </td>
                    
                      <br>(请字数控制在800左右)
                     </td>
                   </tr>
                   
                  <script type=text/javascript> 


include('fckeditor.php');  
  $sBasePath=$_SERVER['PHP_SELF'];  
$sBasePath=dirname($sBasePath).'/';  
$oFCKeditor=new FCKeditor('fckeditor1');  
$oFCKeditor->BasePath=$sBasePath;  
$oFCKeditor -> Create();</script>
          
</body>
</html>在文本框这里调用,还有哪里不对啊,company文件通过文本框的name调用fckeditor,是不是script中的申明错了!

解决方案 »

  1.   

    function checkPostCompany()
    {
      var fck = getEditorHTMLContents('content');
      var intro = fck.GetXHTML(true);  if (checkError('company', 'English')) {
        $('#company').focus();
        return false;
      }
      else if (intro.length <= 125) {
        fck.Focus();
        showError($('#error_intro'), msg_toshort)
        return false;
      }
      else if (checkError('category', 'Empty')) {
        $('#i1').focus();
        return false;
      }
      else if (checkError('address', 'English')) {
        $('#address').focus();
        return false;
      }
      else if (checkError('contact', 'English')) {
        $('#contact').focus();
        return false;
      }
      else if (checkError('tel', 'Phone')) {
        $('#tel').focus();
        return false;
      }
      else if (checkError('email', 'Email')) {
        $('#email').focus();
        return false;
      }  return confirm(msg_submit);
    }$(function() {
      //Submit
      setMsgLanguage();  $('#frm_company').submit(function () {
        return checkPostCompany()
      });  $('#company').blur(function () {
        checkError('company', 'English');
      });    $('#category').blur(function () {
        checkError('category', 'Empty');
      });  $('#address').blur(function () {
        checkError('address', 'English');
      });  $('#contact').blur(function () {
        checkError('contact', 'English');
      });  $('#tel').blur(function () {
        checkError('tel', 'Phone');
      });  $('#email').blur(function () {
        checkError('email', 'Email');
      });
      //Submit  //FCKeditor
      var oFCKeditor = new FCKeditor('content');
      oFCKeditor.Width = 600;
      oFCKeditor.Height = 200;
      oFCKeditor.ToolbarSet = 'basic';
      oFCKeditor.ReplaceTextarea();
      //FCKeditor  //Category
      var opts = {
        'item1' : 'i1',
        'txt'   : [
                    {'id' : 'ename', 'key' : 'category', 'type' : 'html'},
                    {'id' : 'category', 'key' : 'id', 'type' : 'value'}
                  ],
        'curv'  : $('#category').val(),
        'option': ['category', 'id']
      };
      new Category(opts);
      //Category
    });
    这个是company,js
      

  2.   

    $fck->Create();就可以了
    $fck->Value=''设置默认值
      

  3.   

    http://www.cnblogs.com/l9l99/archive/2010/03/13/1684927.html从设置 到调用,讲解的比较详细
      

  4.   


     include('fckeditor.php');  
         $sBasePath=$_SERVER['PHP_SELF'];  
        $sBasePath=dirname($sBasePath).'/';  
        $oFCKeditor=new FCKeditor('fckeditor1');  
        $oFCKeditor->BasePath=$sBasePath;  
        $oFCKeditor -> Create();
    $fck->Create();就可以了
    只要这个就可以 了?
      

  5.   

    不行啊!详细过程我都知道怎么弄,但是上面这个方法我没试过,他是根据name来调用的,但是下面应该也要$fck->Create(); 但是为什么我在script里面写了$fck->Create();还是没用啊