Home>Article>Backend Development> How to use multiple KindEditor editors on one page and pass values to server side
When using the KindEditor today, I need to use two editors on one page. At the beginning, I directly added the code with the same nature as above, and the effect came out. But when submitting, the lower value always overwrites the upper value. I feel that this problem should not be big, so after some tinkering, the effect is finally achieved. This is my personal summary. I hope everyone can learn together and work together. progress!
The following are the steps:
1. Declare an editor array:
var editor = new Array();
2. Display the previous editor line of code:
KindEditor.ready(function(K) { window.editor = K.create('#content', defaultEditorOptions); });
Change the code into an index array form:
KindEditor.ready(function(K) { window.editor[0] = K.create('#content', defaultEditorOptions); window.editor[1] = K.create('#ycontent', defaultEditorOptions); });
In this way, the rendering of the KindEditor editor will be displayed:
3. Pass the relevant data filled in by KindEditor:
The previous transfer method of a KindEditor editor was like this:
The above is the detailed content of How to use multiple KindEditor editors on one page and pass values to server side. For more information, please follow other related articles on the PHP Chinese website!