Home>Article>Backend Development> How to use multiple KindEditor editors on one page and pass values to server side

How to use multiple KindEditor editors on one page and pass values to server side

眼眸间的深情
眼眸间的深情 Original
2021-07-19 19:30:45 2971browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn