FCKeditor 文本编辑器非空验证
来源:互联网 发布:淘宝代购直邮能作假吗 编辑:程序博客网 时间:2024/06/04 18:34
对FCKeditor进行非空验证,使用RequiredFieldValidator验证,会发现需要提交两次才能通过。如下是本人在网上查到的结果转载。
1、添加JS方法
<script language="javascript" type="text/javascript">
var oEditer;
function CustomValidate(source, arguments) {
var value = oEditer.GetXHTML(true);
if (value == "") {
arguments.IsValid = false;
}
else {
arguments.IsValid = true;
}
}
function FCKeditor_OnComplete(editorInstance) {
oEditer = editorInstance;
}
</script>
2、添加CustomValidator验证<asp:CustomValidator ID="CustomValidator1" runat="server" Display="Dynamic" ErrorMessage="商品介绍不能为空" ValidateEmptyText="true" ClientValidationFunction="CustomValidate" ControlToValidate="txtContent"></asp:CustomValidator>
ValidateEmptyText="true" ClientValidationFunction="CustomValidate" 两个属性比较重要,如果没有设置正确,该验证视为无效。
- FCKeditor 文本编辑器非空验证
- asp.net FCKeditor自定义非空验证
- 验证Fckeditor编辑器中的内容是否为空
- 文本编辑器FCKeditor
- 网页文本编辑器(FCKEditor)
- FCKeditor文本编辑器使用说明
- FCKeditor在线文本编辑器
- FCKeditor文本编辑器
- FCKeditor在线文本编辑器
- FCKeditor---html文本编辑器
- 网页文本编辑器(FCKEditor)FCKEditor使用说明
- FCKeditor在线文本编辑器控件
- 关于fckeditor(网页文本编辑器)
- ASP.NET文本编辑器(FCKeditor)
- FCKeditor文本编辑器的使用方法
- FCKeditor 文本编辑器ToolBar工具栏
- FCKeditor文本编辑器的使用方法
- FCKEditor使用非空验证时必须点击两次的解决办法
- MFC托盘图标编程
- CString 不能使用_T("%hs")这种Format
- 初学Windows编程笔记1——窗口和消息
- 虚拟存储器解惑<二>
- [张龙老师Java课程笔记]Java SE第二课 原生数据类型
- FCKeditor 文本编辑器非空验证
- 白手起家:一步一步安装 hadoop on windows
- windows 编程基础
- 有这样一些故事。。。
- document.viewport.getHeight()返回为0
- 恐慌
- :nth-child选择器
- 生产者消费者模型与双缓冲队列
- c# 导出EXCEL