Categorized | Asp.net

Client side Validation with FCK Editor ,Asp.Net

Client side Validation with FCK Editor

RequiredFieldValidator is not work with FCK editor but CustomValidator will work with FCK editor.

<FCKeditorV2:FCKeditor ID=”txtBody” Width=”660px” Height=”360px” runat=”server” ToolbarSet=”MyToolbar” BasePath=”~/FCKEditor/” />

<asp:CustomValidator runat=”server” ID=”CustomValidator2″ SetFocusOnError=”true” ValidationGroup=”cate” Display=”Dynamic” ErrorMessage=”The Page body is not filled” ClientValidationFunction=”ValidateContentText” Text=”*” />

<script type=”text/javascript”>
function ValidateContentText(source, args) {
var fckBody = FCKeditorAPI.GetInstance(‘<%=txtBody.ClientID %>’);
args.IsValid = fckBody.GetXHTML(true) != “”;
}
</script>

1 Comments For This Post

  1. mcdonalds coupon Says:

    Thank you much for this great blog post.

Leave a Reply


  • Popular
  • Latest
  • Comments
  • Tags
  • Subscribe

44,038
Unique
Visitors
Powered By Google Analytics