select 和 input 的不可编辑,input隐藏
select 没有readOnly属性
在jsp中
<select id="a" name="a" disabled="disabled"> disabled确实能使该选择框不能编辑 但是同时也将使其中的值不能提交
<option>A</option>
<option>B</option>
<option>C</option>
</select>
如果你正好用的是google,而且又想提交表单,建议再定义一个<input>存放select的数值,隐藏起来(hidden="true")。那么提交就提交成功该数值了(name要和select的一样的哦~)
<span onmousemove="this.setCapture();" onmouseout="this.releaseCapture();" onfocus="this.blur();">
<select id="a" name="a"> span中的意思是当获焦时 失焦,这样就不能选了,但是google不支持
<option>A</option> 并且jeecg中的<t:dictSelect>也能这样不可选
<option>B</option>
<option>C</option>
</select>
</span>
在js中
$("#a").attr('disabled',true);
input
在jsp中
<input id="b" name="b" disabled="disabled"/> disabled确实能使该文本框不能编辑 但是同时也将使其中的值不能提交
<input id="b" name="b" readOnly="readOnly"/> readOnly能使该文本框不能编辑 而且可以提交其中的值,但是ie8不支持
在js中
$("#b").attr('disabled',true);
$("#a").attr('readOnly',true);
如果你的客户又要用ie8又要用google,我也不知道怎么办了。知道的同学麻烦告诉我一下哦~灰常感谢- -
input隐藏
type="hidden"
hindden="hidden" ie8中还是能看见
select 和 input 的不可编辑,input隐藏的更多相关文章
- 【jQuery获取下拉框select、单选框radio、input普通框的值和checkbox选中的个数】
radio单选框:name属性相同 <input type="radio" id="sp_type" name="p_type" va ...
- input type类型和input表单属性
一.input type类型 1.Input 类型 - email 在提交表单时,会自动验证 email 域的值. E-mail: <input type="email" n ...
- Android input输入框 移动页面input手机键盘中的“搜索”按键
动页面input手机键盘中的“搜索”按键 满足以下几点机即可: input type="search" 放到form标签中 使用action属性 <form ac ...
- 数组乘积--满足result[i] = input数组中除了input[i]之外所有数的乘积(假设不会溢出
数组乘积(15分) 输入:一个长度为n的整数数组input 输出:一个长度为n的整数数组result,满足result[i] = input数组中除了input[i]之外所有数的乘积(假设不会溢出). ...
- Oracle delete input与delete all input
oracle官方文档提示:If you had specified DELETE INPUT rather than DELETE ALL INPUT, then RMAN would have on ...
- 封装input 逐渐,且input插件必须带有默认值。
封装input 逐渐,且input插件必须带有默认值. 组件: <template> <div class="input-show"> <span c ...
- 定制 input[type="radio"] 和 input[type="checkbox"] 样式
表单中,经常会使用到单选按钮和复选框,但是,input[type="radio"] 和 input[type="checkbox"] 的默认样式在不同的浏览器或 ...
- 修改 input[type="radio"] 和 input[type="checkbox"] 的默认样式
表单中,经常会使用到单选按钮和复选框,但是,input[type="radio"] 和 input[type="checkbox"] 的默认样式在不同的浏览器或 ...
- [Angular HTML] Overwrite input value, String.fromCharCode & input.selectionStart
@HostListener('keydown', ['$event', '$event.keyCode']) onKeyDown($event: KeyboardEvent, keyCode) { i ...
随机推荐
- Java被忽略的基本知识(四)
Java IO(不是一般的重要) 54.IO中的流:字节流(InputStream.OutputStream).字符流(Reader.Writer).转换流(InputStreamReader.Out ...
- ajaxfileupload 传参数
引用:http://www.cnblogs.com/lyeo/archive/2012/05/11/2496261.html 直接上代码: var data = { name: 'my name', ...
- 浅谈UI设计中妙用无穷的深色系背景
英文:medium 译者:优设网 - 陈子木 链接:http://www.uisdc.com/ui-benefits-of-dark-background# --------------------- ...
- 如何写出优雅的Python
Looping over a range of numbers Bad: for i in [0,1,2,3,4,5]: print i**2 Good: for i in range(6): pri ...
- python之在线PK游戏(第六天)
本节作业: 熟练使用类和模块,写一个交互性强.有冲突的程序. 故本次写了一个文字回合制的PK游戏,系统主程序为根目录下的:game_menu.py 1. 系统功能模块: 第六天的作业:文字游戏程序 ...
- 刷新或关闭时调用onbeforeunload
Onunload,onbeforeunload都是在刷新或关闭时调用,可以在<script>脚本中通过window.onunload来指定或者在<body>里指定.区别在于on ...
- python27 + windows7 报错 No module named requests
1.下载插件包 地址: http://www.lfd.uci.edu/~gohlke/pythonlibs/#distribute 包名: requests-2.12.4-py2.py3-none-a ...
- linux文件基本属性
在Linux中第一个字符代表这个文件是目录.文件或链接文件等等. 当为[ d ]则是目录 当为[ - ]则是文件: 若是[ l ]则表示为链接文档(link file): 若是[ b ]则表示为装置文 ...
- javascript高级程序设计---第二、三章
在HTML中引用javaScript javascript的几个属性 type async(异步加载 只适用于外部JS且IE8以上 HTML5规范 先于load执行) src defer(延迟加载 ...
- mybatis框架下解决数据库中表的列的字段名和实体类属性不相同的问题
导包.... 实体类中的属性,getter,setter,tostring,构造等方法就不写了 private int id; private String orderNo; private floa ...