FCKEditor使用RequiredFieldValidator验证时必须点击两次的解决办法

添加
<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>

验证码

 

<asp:CustomValidator ID="RequiredFieldValidator" runat="server" ClientValidationFunction="CustomValidate" ValidateEmptyText="true" 
ControlToValidate="fckEditor" ErrorMessage="内容不能为空!"></asp:CustomValidator>

 

 

posted @ 2011-09-19 15:47  分飞  阅读(210)  评论(0编辑  收藏  举报