Opened 10 years ago

Closed 10 years ago

#10901 closed Bug (fixed)

Bug with CKeditor 4 and RequiredFieldValidator with workaround

Reported by: SEFL Owned by:
Priority: Normal Milestone:
Component: Server : ASP.Net Version:
Keywords: Cc:


This is similar in nature to bug #8381, but it's not exactly the same. Here's what I did:

1) Created an form with a single textarea control (which then became the CKEditor control), a .NET submit button (a regular input submit button will "work here" as well), and a RequiredFieldValidator.

The first time the submit button was pressed, the value was passed to the textarea field, but not before the RequiredFieldValidator kicked in saying there was nothing there. The second time, the form submitted.

I worked around this by creating a button tag (as opposed to an input button), updating the textarea once it was clicked, and then submitting the form via jQuery.

I'm not sure if the patch would work, since it appears to apply to and that's no longer in play.

Change History (1)

comment:1 Changed 10 years ago by Jakub Ś

Resolution: fixed
Status: newclosed
Version: 4.2.1

You may use CKE 4.2.1 client-side with CKE ASP.NET 3.6.4 server side.

  1. Go to CKEditor site and download CKEditor 4.2.1 FULL Package
  2. Extract it into ckeditor folder
  3. Go to your_ckeditor_aspnet/_Samples/ and replace existing ckeditor folder with the one you have downloaded.

The only thing you won't be able to set from ASP.NET Control is ACF: CKEditor-4.1-RC-Released!/guide/dev_advanced_content_filter!/api/CKEDITOR.filter-method-addTransformations!/api/CKEDITOR.config-cfg-allowedContent!/api/CKEDITOR.config-cfg-extraAllowedContent which you would have to configure or disable in ckeditor/config.js file.

Now back to the problem.
I have checked CKEditor 3.6.4 ASP.NET with client-side updated to 4.2.1. Next I have opened CKEditorASP_NET/_Samples/SubmitData.aspx and added

<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Content Missing" ControlToValidate="CKEditor1"></asp:RequiredFieldValidator>

Next I have tested page with empty and non-empty content and everything seem to work as expected.

Please check this sample as in my opinion everything works as expected.

@SEFL I’m closing this ticket for now but if there is a way to reproduce this issue in default editor (updated as I’ve described) please leave a comment or sample aspx page that can be put in _Samples folder and will show this issue.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy