您现在的位置: 365建站网 > 365文章 > 百度编辑器ueditor提交无值内容为空的解决办法

百度编辑器ueditor提交无值内容为空的解决办法

文章来源:365jz.com     点击数:1218    更新时间:2018-06-07 22:55   参与评论

ueditor让哥提交了一下午,值都提交不过去,最后只好一步步测试,发现是标签嵌套问题,坑爹啊!!!

捣鼓了好多次之后,我不知怎么的把form这一段代码给他提到table前面(当时是鼠标没控制好给拖到上面一行去了,我一刷新有了,这就奇怪了,我一看我代码的结尾的部分得form都还没写对位置这就好了,难道非要这么写。)所以我就把结尾也给提到table外发现还是好了,这样我貌似看到了希望,所以我试了几下把form放到table的里面,发现就是这个问题,只要放到里面就不行了,所以这个情况还是有点奇怪的。

所以提醒大家,遇到错误可以多试几下。

就是说如果 table 嵌套在 form 标签外面必无法提交,具体ueditor内部代码没有研究

以下为测试代码


以下获取不了值
<table width="100%" border="0" cellspacing="4" cellpadding="2">    
<form action="templets_one_add.php" method="post" name="form1" onSubmit="return checkSubmit()">    
<input type='hidden' name='dopost' value='save'>        
<tr>     
<td height="24" colspan="2" bgcolor="#FBFCE2"">内容:(模板里用{dede:field name='body'/}来获得)</td>    
</tr>    
<tr>     
<td height="80" colspan="2" align="center">     
<script type="text/javascript" src="/include/ueditor/ueditor.config.js"></script>    
<script type="text/javascript" src="/include/ueditor/ueditor.all.min.js"></script>    
<script type="text/javascript" src="/include/ueditor/lang/zh-cn/zh-cn.js"></script>    
<script name="body" id="body" type="text/plain" style="width:100%;height:350px;"></script>    
<script type="text/javascript">UE.getEditor('body');</script>    
</td>    
</tr>    
<tr>     
<td height="53" align="center">&nbsp;</td>    
<td>    
<input name="imageField" type="image" src="images/button_ok.gif" class="np" width="60" height="22" border="0">    
&nbsp;&nbsp;&nbsp;&nbsp;    
<a href="#" onClick="document.form1.reset();"><img src="images/button_reset.gif" width="60" height="22" border="0"></a>    
</td>    
</tr>    
</form>    
</table>    
</td>    
</tr>    
</table>

 

可以获得值
<form action="templets_one_add.php" method="post" name="form1" onSubmit="return checkSubmit()">    
<table width="100%" border="0" cellspacing="4" cellpadding="2">    
<input type='hidden' name='dopost' value='save'>       
<tr>     
<td height="24" colspan="2" bgcolor="#FBFCE2"">内容:(模板里用{dede:field name='body'/}来获得)</td>    
</tr>    
<tr>     
<td height="80" colspan="2" align="center">     
<script type="text/javascript" src="/include/ueditor/ueditor.config.js"></script>    
<script type="text/javascript" src="/include/ueditor/ueditor.all.min.js"></script>    
<script type="text/javascript" src="/include/ueditor/lang/zh-cn/zh-cn.js"></script>    
<script name="body" id="body" type="text/plain" style="width:100%;height:350px;"></script>    
<script type="text/javascript">UE.getEditor('body');</script>    
</td>    
</tr>    
<tr>     
<td height="53" align="center">&nbsp;</td>    
<td>    
<input name="imageField" type="image" src="images/button_ok.gif" class="np" width="60" height="22" border="0">    
&nbsp;&nbsp;&nbsp;&nbsp;    
<a href="#" onClick="document.form1.reset();"><img src="images/button_reset.gif" width="60" height="22" border="0"></a>    
</td>    
</tr>        
</table>    
</td>    
</tr>    
</table>
</form>

 


如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛

发表评论 (1218人查看0条评论)
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
昵称:
最新评论
------分隔线----------------------------

快速入口

· 365软件
· 杰创官网
· 建站工具
· 网站大全

其它栏目

· 建站教程
· 365学习

业务咨询

· 技术支持
· 服务时间:9:00-18:00
365建站网二维码

Powered by 365建站网 RSS地图 HTML地图

copyright © 2013-2024 版权所有 鄂ICP备17013400号