struts2 kindeditor teatarea拿不到值问题。
2019独角兽企业重金招聘Python工程师标准>>>
源:
<script type="text/javascript">var editor;KindEditor.ready(function(K) {editor = K.create('textarea[name="userinfo.introduce"]', {resizeType : 1,allowPreviewEmoticons : false,allowImageUpload : false,afterCreate : function() {var self = this;self.sync();K.ctrl(document, 13, function() {document.forms['addform'].submit();});K.ctrl(self.edit.doc, 13, function() {document.forms['addform'].submit();});}, items : ['fullscreen','source','preview','|','fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link']});});
</script>
HTML代码
<textarea name="userinfo.introduce" style="width:700px;height:200px;visibility:hidden;"></textarea>
这样子在后台的strts2的action中拿到的是空。
只有再加上这段语句才可以获得。
afterBlur:function(){ this.sync(); }
加上后:
<script type="text/javascript">var editor;KindEditor.ready(function(K) {editor = K.create('textarea[name="userinfo.introduce"]', {resizeType : 1,allowPreviewEmoticons : false,allowImageUpload : false,afterCreate : function() {var self = this;self.sync();K.ctrl(document, 13, function() {document.forms['addform'].submit();});K.ctrl(self.edit.doc, 13, function() {document.forms['addform'].submit();});},afterBlur:function(){ this.sync(); }, items : ['fullscreen','source','preview','|','fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist','insertunorderedlist', '|', 'emoticons', 'image', 'link']});});
</script>
转载于:https://my.oschina.net/mcbeathtao/blog/75632
struts2 kindeditor teatarea拿不到值问题。相关推荐
- Struts2中EL表达式的取值范围问题
Struts2中EL表达式的取值范围问题 在Struts2中对request进行了装饰,增强了getAttribute()方法,改变了EL该方法的查找范围,具体为,查找request域,不存在,查找值 ...
- KindEditor得不到textarea值的解决方法----摘至天涯
以前有朋友遇到过这个问题,就是KindEditor在火狐下或者其他浏览器下都无法得到textarea文本框的值,点击表单提交按钮得到的是空白.昨天天涯PHP博客[http://blog.phpha.c ...
- struts2中把action中的值传递到jsp页面的例子
例子: RegistAction的代码: package com.wss.action;import javax.servlet.http.HttpServletRequest;import org. ...
- 取KindEditor中的textarea的值区不到的解决方案,固定kindEditor的高度
可以通过下面的方式取到textarea的值 var content = $(document.getElementsByTagName('iframe')[0].contentWindow.do ...
- struts2中action的class属性值意义
整合了spring就不同了,orz struts2单独使用时action由struts2自己负责创建:与spring集成时,action实例由spring负责创建(依赖注入).这导致在两种情况下str ...
- struts2的注入参数,获取值
首先要配置struts.xml 名字一定是这个,放在src目录下才生效 <?xml version="1.0" encoding="UTF-8" ?> ...
- 【kindeditor】KindEditor获取多个textarea文本框的值并判断非空
kindeditor官网:http://kindeditor.net/demo.php 如何获取多个KindEditor中textarea文本框的值,方式很多种(带有HTML标签). var intr ...
- Struts2中EL表达式取值
http://blog.csdn.net/cuihaiyang/article/details/41950141 (写的不错,可以知道为什么struts2可以用El取属性值的问题.正常el从reque ...
- Struts2框架--学习笔记(下):OGNL表达式、值栈操作、拦截器、struts2标签、文件上传
一.OGNL概述:OGNL是一种表达式 (1)在struts2中操作值栈数据. (2)一般把ognl在struts2中操作,和struts2标签一起使用操作值栈. (3)ognl不是strut2的一部 ...
最新文章
- ​Leangoo在线SaaS模式的产品结构
- No loop matching the specified signature and casting
- XHTML 结构化:使用 XHTML 重构网站
- Redis-17Redis内存回收策略
- ubuntu卸载nvidia驱动_解决Ubuntu18.04循环登录问题 - 卸载NVIDIA驱动 启用Nouveau(1)
- Angular页面在开发模式(DevMode)下的ng-reflect-属性是如何生成的
- 进程与线程的区别(面试题)
- php laravel 优点,Laravel 特点有哪些?
- Python-又到了抢票的季节(带验证码识别验证)
- Bootstrap3 滚动监听插件的选项
- 苹果x屏幕出现一条绿线_部分用户反映苹果 iPhone 12 屏幕出现划痕 - iPhone 12
- Linux学习总结(七十四)自动化运维之ansible
- python做后端速度慢吗_【后端开发】python如何提高运行速度
- Cisco WebEx设备ssl证书安装指南
- 雨滴网易云播放器html代码,【问题求助】这种代码的播放器怎么关联网易云?...
- pointcloud90度分割+球面投影(pcl+ros+python)
- OLED之U8g2中文库使用
- 以太网协议------802.1q,802.1d,802.1x
- 谷歌html弹出ie页面,HTML用JS识别浏览器,IE内核则调用谷歌打开指定链接
- 随机码生成器[10位字母+数字]