Home > Backend Development > PHP Tutorial > Ueditor在thinkphp里提交表单时内容是空的

Ueditor在thinkphp里提交表单时内容是空的

WBOY
Release: 2016-06-06 20:26:26
Original
1350 people have browsed it

实例化编辑器后,在textarea里加上编辑器的id后提交表单时值是空的,如果不加id textarea可以正常提交 求大神解答

回复内容:

实例化编辑器后,在textarea里加上编辑器的id后提交表单时值是空的,如果不加id textarea可以正常提交 求大神解答

Ueditor在给texteara加上id初始化之后,原来的texteara是被隐藏起来了,然后ueditor自己加了一个文本域原来编辑数据,你需要在提交之前使用ueditor的js代码将内容同步到你要的那个texteara。比如:

<code>var ue = UE.getEditor("myEditor");

var content = ue.getContent();

$("#myEditor").val(content);</code>
Copy after login

以上代码只是我的大概意思,你需要结合项目具体参考Ueditor的文档。

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template