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

眼眸间的深情
Release: 2023-04-10 11:34:02
Original
2961 people have browsed it

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();
Copy after login

2. Display the previous editor line of code:

KindEditor.ready(function(K) { window.editor = K.create('#content', defaultEditorOptions); });
Copy after login

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); });
Copy after login

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:

       
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!