1. 引用相关的JS文件
<script src="../../Scripts/fckeditor.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.js" type="text/javascript"></script>
2 $(document.forms.item(0)).validate({
errorClass: "error",
rules:
{
Title: "required",
Content: "required"
},
messages:
{
Title: "*请输入新闻标题",
Content: "*请输入新闻正文"
}
});
详细的使用方法参考: http://student.youkuaiyun.com/space.php?uid=42425&do=blog&id=8663
注意:页面元素的name不能为description,我怀疑是这个名字是做为关键字被jquery validate框架使用.
3富文本代码:
var oFCKeditor = new FCKeditor('description1');
FCKeditor.ToolbarSet = "Wiki";
oFCKeditor.ReplaceTextarea();
<div class="editor-field">
版本说明
<textarea rows="6" id="description1" name="description1"><%=Server.HtmlDecode(this.Model.description)%></textarea>
</div>