а

TinyMCE with dhtmlxForm


#21

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.


#22

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


#23

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???


#24

in your formdetail.php


#25

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?


#26

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.


#27

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


#28

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;

#29

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!


#30

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


#31

Hi

what exact problem do you have?


#32

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!!!


#33

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


#34

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



#35

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


#36

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]); }); } });


#37

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)


#38

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


#39

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) ?


#40

Just downloaded DHTMLX suite this moment
same problems