用jquery.form异步提交页面时,服务器端取不到Ueditor的值
来源:互联网 发布:部落冲突7级哥布林数据 编辑:程序博客网 时间:2024/05/10 23:39
根据Ueditor的帮助说明,默认情况下在服务器端或者Ueditor的值是Request.Form["editorValue"]。1.在没有使用Jquery.form插件的情况下,点击页面的submit,是可以取到值的;2.在使用Jquery.form插件异步提交页面的时候,发现点击submit之后,用firebug查看post信息,里面找不到editorValue,所以在服务端总是取不到Ueditor的值。解决办法:在页面form里添加一个hidden,在submit之前用editor.getContent()获取编辑器的值,并赋给这个hidden;使用Jquery.form插件需要注意:不能再beforeSubmit在个事件中执行上面的操作,虽然也是在执行submit之前,但是提交到服务器端这个hidden还是没有内容的。部分代码如下:
<script language="javascript" type="text/javascript"> var editor; $(document).ready(function() { editor = new baidu.editor.ui.Editor(); editor.render("myEditor"); }); function processJson(data) { if (data.status == "true") { top.$.messager.alert('提示信息', data.msg, 'info', function() { top.closeTab("页脚说明"); }); } else { top.$.messager.alert('提示信息', data.msg, 'error'); } } function SetVal() { var options = { url: "FootInfo.aspx?ps=SAVE", type: "post", dataType: "json", success: processJson }; $("#myContent").val(editor.getContent()); //或者编辑器的值要写在这里或者上面,不能写在beforeSubmit事件里 $("#formPost").ajaxSubmit(options); } </script>
<form id="formPost" method="post" action=""> <input type="hidden" id="myContent" name="myContent" /> <div id="content"> <ul> <li id="editor" style="height:320px;"> <label for="myEditor" style="vertical-align: top"> 页脚描述: </label> <textarea id="myEditor"> <%=strSummary %></textarea> </li> </ul> <div class="pt10 pl125"> <a id="btnSave" href="javascript:void(0)" onclick="SetVal()" class="btn_yl mr10"><span> <span class="fc_42">保存</span> </span></a> </div> </div> </form>
- 用jquery.form异步提交页面时,服务器端取不到Ueditor的值
- html:select 标签 form 提交,action取不到值
- 取不到form标单里的值
- 带返回值的Form表单的异步提交(struts+json+jQuery.form)
- JQuery Form - 异步提交表单
- jQuery异步提交form表单
- jQuery异步提交form表单
- Jquery.Form 异步提交表单
- jQuery异步提交form表单
- jQuery异步提交form表单
- jQuery异步提交form表单
- jQuery异步提交form表单
- jquery.form 异步提交表单
- 1,Tomcat在提交表单时后台取不到值的问题,2,springMVC跳转页面地址错误问题
- form的异步提交
- Request.Form[""]取不到值
- jQuery Form 页面表单提交
- 使用jQuery.form插件,实现完美的表单异步提交
- Linux(虚拟机环境) 下如何安装系统软件包
- 《Xilinx可编程逻辑器件设计与开发(基础篇)》连载49:Spartan-6的PicoBlaze性能
- mysql join的实现原理及优化思路
- 并查集练习---poj 2912
- hdu3316
- 用jquery.form异步提交页面时,服务器端取不到Ueditor的值
- S3C2440 LED 驱动程序详解
- 面向对象和面向过程的区别
- 博客搬家
- 浅谈ARM裸板调试
- poj_1041 John's trip
- [已删除]
- 使用NSFileManager枚举目录种的内容(遍历目录)
- poj_1125 Stockbroker Grapevine