TinyMCE with dhtmlxForm

If I double click the edit item in the grid above and enter the

html in there it saves it to the database successfully.

Don’t understand why the form doesn’t act the same.

please check this
docs.dhtmlx.com/doku.php?id=dhtm … ipting_xss

I see this:

//ConnectorSecurity::$xss = DHX_SECURITY_SAFETEXT;

ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML;

//ConnectorSecurity::$xss = DHX_SECURITY_TRUSTED;

And then:

ConnectorSecurity::$security_key = true;

Question would be… where do I include this code to get this working?

I assume that I would use the ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML; one???

in your formdetail.php

Still don’t understand what is required here.

On this page: docs.dhtmlx.com/doku.php?id=dhtm … p_security
I see this info:
Adding some kind of session-based authentication is strongly recommended.

So if I try to just add the following code in my formdata.php page… it doesn’t do a thing:

ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML;
ConnectorSecurity::$security_key = true;

So I am guessing that this must be contained in some session-based authentication method or something?

I have also read… “By default, connector allows all operations.”

So since I am not even to the point of trying to restrict some
operations… I don’t fully understand how this has anything to
do with the insertion of the html into the database via the
tinymce field.

I can enter regular text into the tinymce field and that will save
to the database now with the update to the code that you mentioned before…
but still no ability to save html… ie… , ,… any
html tags at all.

Hi
do you have all entered data in your database or some chars/words were removed?

There are two different direction for security

a) user-based rules - not all users may have right to edit data in DB, for that you need to add some kind of autorisation to connector ( same as you do for any normal server side code )

b) XSS security - by default connector will remove all html tags from the user’s input, to change behavior, you need to add the next at start of the connector file

ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML;

YEAH… finally!!! It is working perfectly now. Had to add the

ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML; just under this line:

require_once("./connector/form_connector.php");

so that I ended up with:

require_once("./connector/form_connector.php");
ConnectorSecurity::$xss = DHX_SECURITY_SAFEHTML;

Then had to stop magic quotes and finally update the tinymce init to use
instead of


and that did it. It is saving the info that I put in the editor now just as it should be… into the database!

THANKS FOR YOUR RESPONSES AND ASSISTANCE!

Hy Guys!
This is a really OLD post now, is it possible to get it to work with latest v. of tinyMCE ??

Hi

what exact problem do you have?

I took the sample provided in this thead (the zip),
substituted :



For

Subsituted

For

(ALL PATHS TESTED AND WORKING)

And all I get is a multiline input box!!!

Here is the adjusted sample :
sample2.rar (1.34 KB)

Hi

please try attached
dhtmlxform_item_tinymce.js.zip (788 Bytes)

form init

var formData = [ {type: "tinymce", name: "editor_1", label: "TinyMCE #1", value: "this is text for #1"}, {type: "tinymce", name: "editor_2", label: "TinyMCE #2", value: "another text for #2"} ]; var myForm = new dhtmlXForm("myForm", formData);

should look like the following


Almost!

I ONLY get ONE editor, and chrome complains on this line:

tinymce.get(item._tinyId).on(“change”, function(){

ERROR: Uncaught TypeError: Cannot read property ‘on’ of null

hmm, works fine localy both in ff and chrome.

try to modify this part:

tinymce.init({ selector: "#"+item._tinyId, init_instance_callback: function(editor){ editor.on("change", function(){ item._value = this.getContent(); if (!item._unloading) item.getForm().callEvent("onChange", [item._idd, item._value]); }); } });

Getting Worst!!!
Now I still get old error plus new one:

tinymce.get(item._tinyId).on(“change”, function(){
ERROR: Uncaught TypeError: Cannot read property ‘on’ of null

selector: “#”+item._tinyId,
ERROR: caught ReferenceError: item is not defined

Attached my code. Maybe something wrong with the way I put things together …
sample2.rar (1.19 KB)

Well, are you sure your version of dhtmlx is 4.6.1 and version of tinymce is 4.3.7 ?

tinymce_4.3.7.zip
but not sure about DHTMLX suite …
Just says “dhtmlxSuite_v46_std”
SHall I D/L today’s build? Does it have the fix for multirow inputs not working properly?? (dhtmlxjs_46_std_fixed.zip of 16/12) ?

Just downloaded DHTMLX suite this moment
same problems