<form id="ff" method="post">
<div data-options="region:'center',border:false" style="padding:10px;background:#fff;border:1px solid #ccc;">

	
	<div>
		<label for="title">标题:</label>
		<input class="easyui-validatebox" type="text" size="100" id="title" name="Knowledgepoint[title]" data-options="required:true" />
	</div>
	<div>
		<label for="content">内容:</label>
		<textarea name="Knowledgepoint[content]" id="content"></textarea>
	</div>
	<input type="hidden" name="Knowledgepoint[knowledgelist_id]" value="<?php echo $data?>" data-options="required:true" />

</div>
<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0 0;">
	<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:sb()">提交</a>

</div>
</form>
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript">

	function sb(){
		$("#ff").submit();
	}
$('#ff').form({
        url:"<?php echo $this->createUrl('create');?>",
        onSubmit: function(){
						   var isValid = $(this).form('validate');
			   if (!isValid){
							  $.messager.progress('close');              // hide progress bar while the form is invalid
			   }
			   return isValid;         // return false will stop the form submission
        },
        success:function(data){
                if(data=='yes'){
					$.messager.alert('提示','新增成功！请继续添加！','info');
					$("#title").attr("value","");
					$("#content").attr("value","");
				}else{
					$.messager.alert('提示','新增失败！<br/>原因：1、内容为空！2、标题重复！','error');
				}
        }
});
    CKEDITOR.replace("Knowledgepoint[content]",
      {
        skin: "v2", width:"835", height:"400",color:"#AADC6E",toolbar:"Full",language:'zh-cn',
		filebrowserBrowseUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/ckfinder.html',
		filebrowserImageBrowseUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/ckfinder.html?Type=Images',
		filebrowserFlashBrowseUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/ckfinder.html?Type=Flash',
		filebrowserUploadUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
		filebrowserImageUploadUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
		filebrowserFlashUploadUrl : '<?php echo Yii::app()->request->baseUrl?>/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
      });	  
</script>
<script type="text/javascript" src="/ueditor/editor_config.js"></script>
<script type="text/javascript" src="/ueditor/editor_all_min.js"></script>
<link rel="stylesheet" href="/ueditor/themes/default/ueditor.css"/>
<script type="text/javascript">
	//var editor = new baidu.editor.ui.Editor();
	//textarea:'content';
	//editor.render("content");
</script>