一个页面如何放多个百度编辑器 Ueditor 1.4.3?PHP如何获取Ueditor 的值?
2016-07-18 13:51
603 查看
问题1:一个页面如何放置多个Ueditor?
参考代码如下:
<form method="post" action="save.php">
<script type="text/plain" id="ueditorId_1" name="ueditorName_1" style="width: 400px;height:500px;">编辑器的默认值_1</script>
<script type="text/javascript">
UE.getEditor('ueditorId_1');
</script>
<script type="text/plain" id="ueditorId_2" name="ueditorName_2" style="width: 450px;height:550px;">编辑器的默认值_2</script>
<script type="text/javascript">
UE.getEditor('ueditorId_2');
</script>
</form>
这样,就会在页面中渲染2个Ueditor编辑器。
问题2:PHP如何获取Ueditor的值?
注意,上面的 ueditorName_1,ueditorName_2 即为表单的Name值,所以服务端PHP获取Ueditor编辑器的值变得很简单,参考代码如下:
$_POST["ueditorName_1"]; // 第一个编辑器的值
$_POST["ueditorName_2"]; // 第二个编辑器的值
参考代码如下:
<form method="post" action="save.php">
<script type="text/plain" id="ueditorId_1" name="ueditorName_1" style="width: 400px;height:500px;">编辑器的默认值_1</script>
<script type="text/javascript">
UE.getEditor('ueditorId_1');
</script>
<script type="text/plain" id="ueditorId_2" name="ueditorName_2" style="width: 450px;height:550px;">编辑器的默认值_2</script>
<script type="text/javascript">
UE.getEditor('ueditorId_2');
</script>
</form>
这样,就会在页面中渲染2个Ueditor编辑器。
问题2:PHP如何获取Ueditor的值?
注意,上面的 ueditorName_1,ueditorName_2 即为表单的Name值,所以服务端PHP获取Ueditor编辑器的值变得很简单,参考代码如下:
$_POST["ueditorName_1"]; // 第一个编辑器的值
$_POST["ueditorName_2"]; // 第二个编辑器的值
相关文章推荐
- iOS UITableView(三)-下拉刷新、上拉加载
- MySQL Quick guide
- 问题:获取屏幕尺寸不正确(UIScreen mainScreen bounds)
- iOS开发之键盘类型UIKeyboardType
- Permutation Sequence
- 1062. Talent and Virtue (25)
- [goa]golang微服务框架学习(三)-- 使用swagger-ui展示API
- easyUi弹出window窗口传值与调用父页面的方法,子页面给父页面赋值
- ugui mask失效
- 淘宝druid数据库连接池使用示例
- The Definitive Guide to Using Negative Margins
- NGUI拖动摄像机实现面板上下拖动
- Git学习总结(7)——Git GUI学习教程
- Git学习总结(7)——Git GUI学习教程
- Hive分析窗口函数(四) LAG,LEAD,FIRST_VALUE,LAST_VALUE
- 25.Which three operations require undo data? (Choose three.)
- AbstractQueuedSynchronizer(十四)——应用之FutureTask
- EasyUI DataGrid 使用(分页,url数据获取,data转json)
- Module build failed: SyntaxError: E:/wp+rc/try/src/index.js: Unexpected token
- UGUI ScrollRect滑动定位优化