百度编辑器ueditor 的 submit 表单提交
页面中表单提交代码:
<input type="submit" name="Submit" value="修改保存">
提交的结果正常!
在另一个页面中提交代码如下:
<td height="30" style="PADDING-LEFT: 10px"><input type="submit" name="Submit" value="提交发表" onClick="document.form1.Content.value = frames.message.document.body.innerHTML;"></td>
提交后结果丢失(编辑框内容并没有被写出)!
百度结果:
当前页面 表单 form1 里 content元素的值= 框架页面message 的所有HTML代码
检查表单的标签发现缺少iframe框架标签,添加后正常提交
<iframe>
<script type="text/javascript">
var editor= UE.getEditor('Content');
</script>
</iframe>
不过出现新的问题,页面中工具栏不见了,以及多了一个框架:

最后改回直接调用方式:
function ResetForm(){
if (window.confirm('确认要清空对话框内容?')){
UE.getEditor('Content').setContent('');
return true;
}
return false;
}
...
</script> <title>修改内容</title>
<link href="ueditor/themes/iframe.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html;charset=gbk"/>
<script type="text/javascript" charset="gbk" src="ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="gbk" src="ueditor/ueditor.all.min.js"> </script>
<!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文-->
<script type="text/javascript" charset="gbk" src="ueditor/lang/zh-cn/zh-cn.js"></script>
<div>
<textarea name="Content" id="Content" type="text/plain" style="width:1024px;height:500px;"></textarea>
</div>
<script type="text/javascript">
var editor= UE.getEditor('Content');
</script> </td>
</tr>
<tr> </tr>
<tr bgcolor="#E8F1FF">
<td align="right"></td>
<td height="30" style="PADDING-LEFT: 10px"><input type="submit" name="Submit" value="提交发表" onClick="document.form1.Content.value = UE.getEditor('Content').getContent();"><input onClick="ClearReset()" type=reset name="Clear" value="重新填写"></td>
</tr>
在消除的回调中加入UE.getEditor('Content').setContent('');
在提交的回调中加入document.form1.Content.value = UE.getEditor('Content').getContent();
结果工作正常!
最坑爹的是,提交不到数据竟然跟form所在的表格层次有关,直接将
原代码位置:
<body>
<table class="tableBorder" width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#E8F1FF">
<td align="center" background="../images/admin_bg_1.gif" height="25"><b>添加新产品目录</b> </td>
</tr>
<tr bgcolor="#E8F1FF">
<form name="myform" method="post" action="saveaddproductyp.asp?action=add" OnSubmit="return checkkk()" >
移动form位置后:
<body>
<form name="myform" method="post" action="saveaddproductyp.asp?action=add" OnSubmit="return checkkk()" >
<table class="tableBorder" width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#E8F1FF">
一切正常了!坑!!!
百度编辑器ueditor 的 submit 表单提交的更多相关文章
- type="submit"表单提交理解
1.默认为form提交表单 . button则响应用户自定义的事件,如果不指定onclick等事件处理函数,它是不做任何事情.当然,button也可以完成表单提交的工作. 2.method=" ...
- Form Submit表单提交
<button type="button" ng-click="submit()"class="btn btn-block btn-danger ...
- html表单提交方式
xml 表单提交方式: * 使用submit提交 <form> 要提交的数据 <input type="submit" /'> </form> ...
- jquery表单提交和重置
$('#myform').submit() 表单提交 $('#myform')[0].reset() 表单重置
- 关于form与表单提交操作的一切
原文链接:http://caibaojian.com/form.html 你知道,一个表单里面只要有form元素,如果没有给action加一个默认值,为空白的时候,当你刷新页面时,会弹出一个警告框提示 ...
- summernote富文本编辑器配合validate表单验证无法进行表单提交的问题
1.使用summernote富文本编辑器提交图片到服务器 在使用bootstrap中,我们用到了summernote富文本编辑器,使用summernote将图片上传到服务器中,参考我的上篇文章http ...
- 表单提交中的input、button、submit的区别
1.input[type=submit] 我们直接来看例子: 代码如下: <form> <input name="name"> <input type ...
- 在表单提交之前做校验-利用jQuery的submit方法
点击表单中的提交按钮,默认就会提交表单,如果要在表单提交之前做一些校验,那么就可以用jQuery的submit方法. 也就是jQuery的submit的方法执行顺序,在表单的提交之前.用法如下: $( ...
- 表单提交:button input submit 的区别
http://harttle.com/2015/08/03/form-submit.html 最近项目代码中的表单提交的方式已经百花齐放了,现在用这篇文章来整理一下不同表单提交方式的区别,给出最佳实践 ...
随机推荐
- Apache 启动.htaccess 的操作方法
配置apache主配置文件(httpd.conf) 1.查找“#LoadModule rewrite_module modules/mod_rewrite.so” 去掉前面的#号 2.把AllowOv ...
- SQL优化
1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索 ...
- Openstack4j 在 Maven 中的构建
什么是 Openstack4j ? OpenStack的官方SDK是基于Python语言的,对于Java程序猿来说,将Python翻译过来未免麻烦.在Openstack官方的Wiki中(戳我直达),我 ...
- poj2236_并查集_Wireless Network
Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 24497 Accepted: 102 ...
- node06-path
目录:node01-创建服务器 node02-util node03-events node04-buffer node05-fs node06-path node07-http node08-exp ...
- Yii 动作过滤的方法
protected function _init() { } public function beforeAction($action) { //黑名单 $blackList = array('tes ...
- Revolving Digits(hdu 4333)
题意:就是给你一个数字,然后把最后一个数字放到最前面去,经过几次变换后又回到原数字,问在这些数字中,比原数字小的,相等的,大的分别有多少个.比如341-->134-->413-->3 ...
- 如何解决自动加载与模板中(如Smarty)的自动加载冲突的问题
function aotuman($class){ include('./'.$class.'.class.php'); } spl_autoload_register('automan'); / ...
- jQuery+HTML5实现上传文件预览
<!DOCTYPE html> <html> <head> <title>HTML5上传图片预览</title> <meta http ...
- 低功耗蓝牙BLE之连接事件、连接参数和更新方法
转自:http://blog.csdn.net/zzfenglin/article/details/51304084 连接事件 在一个连接当中,主设备会在每个连接事件里向从设备发送数据包.一个连接事件 ...