I have just recently started developing my back end systems with dhtmlx and I would like to first thank all the developers for such an amazing and powerful tool.
I would like to use tinyMCE with the dhtmlxForm component, I have seen in one of the support pages that you have created a sample for people in the past on how to go about it but the code was not publicly available unfortunately, could you please guide me on how to do this or if you could provide a sample of how to use tinyMCE with dhtmlxForm I would really appreciate it as my system is in dire need of it.
The same can be used for the CKEditor editor - see attached. We did not add destruct() and other methods for this item type. You may add them yourself if theyâre needed. dhtmlxform_ckeditor.zip (32.3 KB)
Thank you for your response. It worked for me after I included the CKEditor source (missing from the provided sample download).
I can also report the provided sample also honours the CKEditor config.js configurations. I wasnât sure how to put the editor configurations in the sample.html.
The editor in the form can also be instantiated using XML.
[code] function doOnLoad() {
myForm = new dhtmlXForm("myForm");
myForm.loadStruct("codebase/cked.xml");
}[/code]
You said: " I found that the tinyMCE prototype does not send data back to be saved. I had to add" and then you give the code.
I am trying to use that to see if I can get my form to send the info back to the database with a tinymce editor field. I have it working in the form ⊠just wonât submit the info to the db.
Can you tell me just a bit more about how to get this working. It appears that the first part of the code you suggest goes into the tinyMCE.init({ }); Area. Got that in place but not sure where theâŠ
function tinyMCEsendData(inst){
//alert(inst.getBody().innerHTML); //test
dpf.sendData();
}
goes??? And then I see sendData(); at the top or your reply. Should that be included somewhere as well. I do have the send button on the form with this code:
myForm.attachEvent(âonButtonClickâ, function(id){
if (id==âsaveâ){
myForm.save();// saves data to db
alert(âYour Information Was Submitted Successfully!â);
}
});
Does that have to be altered somehow? I was just thinking that your sendData(); may be something like the myForm.save(); info in my code??? No???
Correct, the first part goes into the tinyMCE.init({ }) list.
Just make sure that when you append the: onchange_callback : âtinyMCEsendDataâ that there is a comma between it and the previous pair (no comma at the end).
This part tells the tinyMCE code to execute a function named âtinyMCEsendDataâ after the editor recognized a change. At this point we havenât actually saved anything; this only created a call to a function named âtinyMCEsendDataâ, and inside that function there is code that does the saving.
In my case I save my form with the command: dpf.sendData();
And my function is:
function tinyMCEsendData(inst){
dpf.sendData();
}
The function name: tinyMCEsendData is the connection with âtinyMCEsendDataâ above. I could have picked any other name as long as the init and function match.
You would replace dpf.sendData(); with whatever command you use to save your form.
I have this function located in the same js area as the vast majority of my code between:
dhtmlxEvent(window,âloadâ,function(){ })
My excuses for the sendData(); on top; it was intended to help focus on the subject as a header.
Sorry, donât understand that reply. Is it possible for you to send email returned with the changes you are suggesting? A reply to my email with the code you are suggesting?
Yes, just updated that line and it did save the info from the editor⊠the only issue there is that it is not inserting html code to database. For example⊠if I want to use the editor to insert an image like this:
then it does not save it that way⊠ends up being empty???
Same if I try and choose a font-family, font-size, font-color, etcâŠ
Does not save it that way. Strips html code but does save escape slashes like: Letâs
The purpose for the tinymce editor is so that I can save the html to the database and then retrieve it for display pages. Even to use edit and delete images in the edit and delete fields at some point.