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隐藏的更多相关文章

  1. 【jQuery获取下拉框select、单选框radio、input普通框的值和checkbox选中的个数】

    radio单选框:name属性相同 <input type="radio" id="sp_type" name="p_type" va ...

  2. input type类型和input表单属性

    一.input type类型 1.Input 类型 - email 在提交表单时,会自动验证 email 域的值. E-mail: <input type="email" n ...

  3. Android input输入框 移动页面input手机键盘中的“搜索”按键

    动页面input手机键盘中的“搜索”按键 满足以下几点机即可: input type="search"    放到form标签中    使用action属性 <form ac ...

  4. 数组乘积--满足result[i] = input数组中除了input[i]之外所有数的乘积(假设不会溢出

    数组乘积(15分) 输入:一个长度为n的整数数组input 输出:一个长度为n的整数数组result,满足result[i] = input数组中除了input[i]之外所有数的乘积(假设不会溢出). ...

  5. Oracle delete input与delete all input

    oracle官方文档提示:If you had specified DELETE INPUT rather than DELETE ALL INPUT, then RMAN would have on ...

  6. 封装input 逐渐,且input插件必须带有默认值。

    封装input 逐渐,且input插件必须带有默认值. 组件: <template> <div class="input-show"> <span c ...

  7. 定制 input[type="radio"] 和 input[type="checkbox"] 样式

    表单中,经常会使用到单选按钮和复选框,但是,input[type="radio"] 和 input[type="checkbox"] 的默认样式在不同的浏览器或 ...

  8. 修改 input[type="radio"] 和 input[type="checkbox"] 的默认样式

    表单中,经常会使用到单选按钮和复选框,但是,input[type="radio"] 和 input[type="checkbox"] 的默认样式在不同的浏览器或 ...

  9. [Angular HTML] Overwrite input value, String.fromCharCode & input.selectionStart

    @HostListener('keydown', ['$event', '$event.keyCode']) onKeyDown($event: KeyboardEvent, keyCode) { i ...

随机推荐

  1. UVALive 7146 Defeat the Enemy(贪心+STL)(2014 Asia Shanghai Regional Contest)

    Long long ago there is a strong tribe living on the earth. They always have wars and eonquer others. ...

  2. android手机和ios手机的分辨率

    Android手机目前常见的分辨率 1.1 手机常见分辨率: 4:3 VGA     640*480 (Video Graphics Array) QVGA  320*240 (Quarter VGA ...

  3. 数据库中老师学生家长表添加自动同意好友自动(AgreeAddingFriend ),默认为True

    数据库中老师学生家长表添加自动同意好友自动(AgreeAddingFriend ),默认为True alter table Sys_User add AgreeAddingFriend bit alt ...

  4. Java表单中关于JavaScript的非空必输验证,你的程序和大牛有多少差距╮( ̄▽ ̄")╭

    var defaultEmptyOK = false; // スペース var whitespace = " \t\n\r "; function checkNull (theFi ...

  5. hibernate配置文件详细解析

    在javaweb开发中,hibernate框架的是常用的,能帮我们节省大量的时间,以下是hibernate的配置文件解析. hibernate配置文件的默认名为:hibernate.cfg.xml 默 ...

  6. python之在线PK游戏(第六天)

      本节作业: 熟练使用类和模块,写一个交互性强.有冲突的程序. 故本次写了一个文字回合制的PK游戏,系统主程序为根目录下的:game_menu.py 1. 系统功能模块: 第六天的作业:文字游戏程序 ...

  7. Java设计模式(三)——观察者模式和监听器

    为了实现多个模块之间的联动,最好的方法是使用观察者模式.网上介绍的资料也比较多,今天我就从另一个方面谈谈自己对观察者模式的理解.从JDK提供的支持库里,我们能够找到四个对象:Observable.Ob ...

  8. mysql 5.7.16 远程连接

    1登录到mysql中,为root进行远程访问的授权,所以主机都可以链接 GRANT ALL PRIVILEGES ON . TO 'root'@'%'IDENTIFIED BY 'mypassword ...

  9. sql 查询表中所有字段的名称

    最近工作用到SQL语句查询表中所有字段的名称,网上查询,发现不同数据库的查询方法不同,例如: SQL server 查询表的所有字段名称:Select name from syscolumns Whe ...

  10. angularjs checkbox 框的操作

    前言:今天遇到一个问题,需要对多选按钮进行操作,作为js菜鸟,只能做自己慢慢琢磨了-- <label class="checkbox-inline custom-checkbox no ...