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. 关于hasNextInt判断后无限循环输出else项的解决办法

    话不多说,上来就是干! import java.util.Scanner; public class Test_hasNextInt { /** * @param args */ public sta ...

  2. bootstraptable插件文档的坑

    1.事件onCheck中文档参数为row, $element正确的顺序为$element,row eg: $Table.on('check.bs.table', function ($element, ...

  3. Spring学习笔记之三----基于Annotation的Spring IOC配置

    使用Annotation 来创建Bean有两种方式 在配置类中创建bean(配置类是指标注为@Configuration的类),在配置类中每一个创建bean的方法都应该标注为@Bean,可以在@Bea ...

  4. spring boot servlet 注入

    spring boot 注入servlet的方法是借助ServletRegistrationBean这个类 例子如下: 先建一个servlet import java.io.IOException; ...

  5. Thinkphp批量添加数据

    //新建规格public function construction(){ $id = $_GET['id'];//dump($id);die; $this->assign('id', $id) ...

  6. DLL库

    6.阿里云上传.下载:Aliyun.OSS.dll https://help.aliyun.com/ 5.SQLite数据库操作:SQLite.Interop.dll.SQLite.Designer. ...

  7. 一个前端引用Facebook评论插件案例

    最近公司海外的同事提了一个新的需求:那就是将Facebook的评论系统接入到公司海外网站的资讯详情页. 下面做一个简单的介绍: 首先我们登录到Facebook开发者平台:然后进入评论插件系统(http ...

  8. IOS 视频缩略图的生成

    使用AVFoundation框架可以生成视频缩略图,用到的类: >>AVAsset: 用于获取多媒体的相关信息,如多媒体的画面和声音等. >>AVURLAsset: AVAss ...

  9. 基于webrtc的资源释放问题(二)

    基于webrtc的资源释放问题(二) ——建立连接的过程中意外中断 应用背景: 我们在打电话的时候会不会遇到这种情况?打电话的时候未接通之前挂掉了电话,或者在接通之后建立的连接的过程中挂掉电话? 特别 ...

  10. .net 之缓存

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...