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 >

 

 

你可能感兴趣的:(fckeditor)