PHP CI框架文本编辑器怎么第一次提交数据的时候为空,第二次就成功?

PHP CI框架文本编辑器怎么第一次提交数据的时候为空,第二次就成功?
//控制器
//添加展示界面
function addinfo(){

$allowUpload = configItem('fileUpload');
$this->load->helper('remoteupload');
$this->load->library('fckeditor');

$this->template->importJavascript(array('customer'));

$this->template->cpView('customer_add');

}
//添加展示方法
function addtj(){

$data=array(
    'name'=>$this->input->post('name'),
    'content' =>str_replace('_baidu_page_break_tag_', '<pagebreak></pagebreak>', $this->input->post('content',false))
);


if (empty($data['name'])) {


   $this->message->response(false, '请填写标题!'); 

 } 
 else if (empty($data['content'])){
     $this->message->response(false,"请填写内容");
 }

 else  if($this->customermodel->getList("c.name = '" . $data['name'] . "'")){

     $this->message->response(false, '展示名称已存在!'); 
} 

else {
    $this->customermodel->add($data);


  $this->message->response(true, '添加成功!');  

}

}

//视图

增加中心介绍
展示标题:
内容
fckeditor->Create($content, 300, '98%','content'); ?>

//JS
add: function() {
var name = $('#name');

if (name.val() == "") {
    alert('请填写标题名称!');
    name.focus();
    return false;
}

/*
alert($('#content').val());

return false;*/

$("#btnSubmit").attr("disabled", "disabled");
Ajax.postForm("goodsForm", function(json) {
$("#btnSubmit").removeAttr("disabled");
if (json.status) {

        alert(json.msg);
        document.location.href = "customer.php";
    } else

        alert(json.msg);
});
return false;

上代码,以后提问题记得带上代码,不然谁知道你说的什么

//控制器

//添加展示界面
function addinfo(){

    /*  
    $id = $this->input->get('id');
    $data = null;

    if ($id) {
        $data = $this->customermodel->getByID($id);
    }

*/
$allowUpload = configItem('fileUpload');
$this->load->helper('remoteupload');
$this->load->library('fckeditor');

        $this->template->importJavascript(array('customer'));

        $this->template->cpView('customer_add');

}
//添加展示方法
function addtj(){

    $data=array(
        'name'=>$this->input->post('name'),
        'content' =>str_replace('_baidu_page_break_tag_', '<pagebreak></pagebreak>', $this->input->post('content',false))
    );


    if (empty($data['name'])) {


       $this->message->response(false, '请填写标题!'); 

     } 
     else if (empty($data['content'])){
         $this->message->response(false,"请填写内容");
     }

     else  if($this->customermodel->getList("c.name = '" . $data['name'] . "'")){

         $this->message->response(false, '展示名称已存在!'); 
    } 

    else {
        $this->customermodel->add($data);


      $this->message->response(true, '添加成功!');  

    }

}
/*  echo '<script type="text/javascript">alert("请填写标题");document.location.href = "customer.php/addinfo";</script>'; */

//视图

    <script type="text/javascript" src="/plugins/swfupload_v25_beta3/swfupload.js?v=<?php echo configItem('cssVersion') ?>"></script>
增加中心介绍
展示标题:
内容
fckeditor->Create($content, 300, '98%','content'); ?>

//JS

add: function() {
var name = $('#name');

    if (name.val() == "") {
        alert('请填写标题名称!');
        name.focus();
        return false;
    }

   /*
    alert($('#content').val());

    return false;*/
 $("#btnSubmit").attr("disabled", "disabled");
    Ajax.postForm("goodsForm", function(json) {
        $("#btnSubmit").removeAttr("disabled");
        if (json.status) {

            alert(json.msg);
            document.location.href = "customer.php";
        } else

            alert(json.msg);
    });
    return false;