0
我想修改下面的自定义验证程序,以便它检查RadEditor不是空的,或者不仅包含像br和p标签等HTML标签,而且它必须是一些文本,而不是只是HTML标签。我如何实现我想要的?关于自定义验证
<asp:CustomValidator runat="server" ID="CustomValidator1" ControlToValidate="RadEditor1" ClientValidationFunction="checkLength">* The text length should not exceed 50 symbols.</asp:CustomValidator>
<script type="text/javascript">
var limitNum = 50;
function checkLength(sender, args)
{
//Note that sender is NOT the RadEditor. sender is the <span> of the validator.
//The content is contained in the args.Value variable
var editorText = args.Value;
args.IsValid = editorText.length < limitNum;
}
事情是当我使用RadEditor所需的字段验证器时,br标记被存储为值,因此验证失败。那么,如何编写一个自定义验证器来检查编辑器是否只有html标签?
lemme试试这个..thnx – Serenity 2010-12-17 11:23:52