Opened 16 years ago

Closed 14 years ago

#3279 closed Bug (duplicate)

CKEDITOR.replace(el) breaks save button's submit action

Reported by: Colin Wismean Owned by:
Priority: Normal Milestone:
Component: General Version: SVN (CKEditor) - OLD
Keywords: Cc:

Description

Working with "divreplace.html" from the samples folder, the "Save" button will not post back/submit the form that it is related to.

The "Save" button works fine in other areas, so I am assuming that its when you use CKEDITOR.replace() that it breaks. I have followed the javascript to its final method call when you click the button, and all seems the same.

Using Firebug, if I replace the onclick method call with [form name].submit() it works fine.

Could the "Save" button not picking up the correct name of the form when the CKEDITOR.replace(el).

Thanks

Attachments (2)

ckeditor.htm (2.3 KB) - added by Colin Wismean 16 years ago.
HTML File with FORM and DIV replace
3279.patch (1.6 KB) - added by Artur Formella 16 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 16 years ago by Garry Yao

Could you please provide a sample page for reproducing purpose?

comment:2 Changed 16 years ago by Colin Wismean

http://ckeditor.com/ckeditor/3.0b2/_samples/divreplace.html

Double click on the div, hit the "save" icon in the editor. The page doesn't submit.

comment:3 Changed 16 years ago by Garry Yao

Resolution: invalid
Status: newclosed

The save function require at least one wrapping 'form' surrounding in order to perform the submit, so 'divreplace.html' example page is not a certificate playground for this feature, please use other pages for this feature.
BTW,please use our nightly build page for testing.

Changed 16 years ago by Colin Wismean

Attachment: ckeditor.htm added

HTML File with FORM and DIV replace

comment:4 Changed 16 years ago by Colin Wismean

Resolution: invalid
Status: closedreopened

I have downloaded the nightly build, I have added it to my project, I have checked if a form was wrapped around my local copy - which it was - and although the new interface looks awesome, the save button is now disabled.

I have attached a file ( you will need to change file references ) but if this isn't a bug, are you able to show how to enable the "Save" functionality when the div replace method is used?

comment:5 Changed 16 years ago by Artur Formella

Keywords: Confirmed added
Owner: set to Artur Formella
Status: reopenednew
Version: SVN (CKEditor)

Changed 16 years ago by Artur Formella

Attachment: 3279.patch added

comment:6 Changed 16 years ago by Artur Formella

Keywords: Review? added

comment:7 in reply to:  4 Changed 16 years ago by Garry Yao

Replying to colin.wiseman: Thanks for the provided sample page, but it's meaningless to submit a surrounding form of the replaced 'div' since no form fields existed, it's different from replace a 'textarea'.CKEditor won't establish form fields automatically in this case, so instead of relaying on the 'save', the data should be fetched from editor.getData() function and get submmited with your own codes.

comment:8 Changed 16 years ago by Colin Wismean

Hi,

Thanks for the reply. So basically what you are saying is, by using a CKEDITOR.reaplce(div) i cannot use the inbuilt "Save" button on the CKEditor toolbar. I would have to supply my users a seperate button that would use another method e.g. an ajax postback to a url with the value from the editor.

Seems a bit of a faff really but easily doable and kinda understandable - nothing to submit etc.

Quick question then, is there a way I can hook into the "Save" button, enable it, but replace the "Save" event's function with my own function - so i can do an ajax save type of thing...

Thanks for your time on this.

comment:9 Changed 16 years ago by Artur Formella

colin.wiseman, you can use

<form onsubmit="mySubmit(); return false">

Patch provides abstraction of the input. User just want to have CKeditor in form.

I was thinking about "save" event which could be canceled to stop normal submitting. Save button could be active even without form element but if "save" event has listeners. Usage of this would be very easy.

comment:10 Changed 16 years ago by Artur Formella

Milestone: CKEditor 3.x

comment:11 Changed 15 years ago by Artur Formella

Owner: Artur Formella deleted

comment:12 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:13 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: duplicate
Status: reviewclosed

This feature is to be covered by #4507.

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