form表单元素设置只读

CreateTime--2017年5月5日11:42:41

Author:Marydon

1.设置文本框只读

<!--  方法一:简写 -->
<input type="text" name="" value="文本框" class="" readonly/>
<!-- 方法二:写全 -->
<input type="text" name="" value="文本框" class="" readonly="readonly"/>

2.设置单选框只读(禁用)

<td class="tdbiejing" nowrap="nowrap">允许调剂</td>
<td nowrap="nowrap">
<label class="radioCss">
<input name="isAdjust" id="" type="radio" value="" disabled
<c:if test="${model.coumn==0 }">checked</c:if>/>

</label>
<label class="radioCss">
<input name="isAdjust" id="" type="radio" value="" disabled
<c:if test="${model==1 }">checked</c:if>/>

</label>
</td>

3.禁用下拉列表框

<select id="" name="" nowrap="nowrap" class="TextBox" disabled>
<option value="">选项一</option>
<option value="">选项二</option>
<option value="">选项三</option>
</select>

小结:

  1.标签属性:只读readonly、禁用disabled、单选框&复选框默认选中checked、下拉列表框默认选中selected都可以简写;

  2.设置disabled属性后,该元素的数据将无法提交,可以添加一个隐藏域

    <input id="" name="" type="hidden" value="" />。

相关推荐:

 

form表单元素设置只读的更多相关文章

  1. jQuery操作Form表单元素

    Web开发中常常须要操作表单,form表单元素有select.checkbox.radio.textarea.button.file.text.hidden.password等. 当中checkbox ...

  2. 【jQuery】form表单元素序列化为json对象

    序列化form表单元素为json对象: <!Doctype html> <html xmlns=http://www.w3.org/1999/xhtml> <head&g ...

  3. form表单元素的值序列化成对象

    /** * 将form表单元素的值序列化成对象 * param: form jquery form对象 */ var serializeObject = function(form) { var o ...

  4. 将form表单元素的值序列化成对象

    /**jQuery * 将form表单元素的值序列化成对象 * @returns object */ var serializeObject = function(form) { var o = {} ...

  5. Form表单元素

    Form表单元素 action method input: name value type: text password button radio checkbox file submit reset ...

  6. form表单元素中disabled的元素的值不会提交到服务器

    1.表单元素中disabled的元素的值不会提交到服务器,后台获取的值为null <form id="myForm" action="#" method= ...

  7. jQuery控制form表单元素聚焦

      CreateTime--2017年5月28日08:57:16Author:Marydon jQuery使form表单的第一个文本框聚焦 /** * 使form表单的第一个文本框聚焦 */ func ...

  8. Jquery学习笔记:操作form表单元素之二(复选框和单选框)

    在上面文章的基础上,我们介绍如何操作表单元素中的 复选框和单选框. 一.复选框 <label> <input type="checkbox" id="i ...

  9. HTML 中按钮作为form表单元素提交特性两则 --- 参HTML考标准分析

    相同name的submit 类型的input提交行为 描述 这种情况, <input type="submit" name="ACTION" value= ...

随机推荐

  1. 五、python的练习题

    1.输入一行字符,分别统计出其中英文字母.空格.数字和其他字符的个数. #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/6/5 ...

  2. Java 常用远程调用协议比较

    一.综述本文比较了RMI,Hessian,Burlap,Httpinvoker,web service等5种通讯协议的在不同的数据结构和不同数据量时的传输性能.RMI是java语言本身提供的远程通讯协 ...

  3. HDU 4669 Mutiples on a circle (2013多校7 1004题)

    Mutiples on a circle Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Oth ...

  4. Spring MVC表单处理

    以下示例演示如何编写一个简单的基于Web的应用程序,它使用Spring Web MVC框架使用HTML表单. 首先使用Eclipse IDE,并按照以下步骤使用Spring Web Framework ...

  5. [置顶] linux学习之静态库和动态库的制作与使用

    linux中静态库和动态库的制作与使用 一.静态链接库 1.首先编写模块程序example.c.example.h 2.使用gcc -c example.c -o example.o编译example ...

  6. ffmpeg的IO操作

    ffmpeg 可以通过IO操作将数据读取和存储在文件或网络中 作为数据的读取和写入地址,数据被存放在file,http, ffmpeg 不仅可以编解常用的音视频格式,还可以将数据导入/导出到各种媒介中 ...

  7. 关于String 后面跟省略号。。。

    今天阅读MonkeyRunner源码的时候发现下面一段: private String shell(String... args) { StringBuilder cmd = new StringBu ...

  8. MFC 获取DC和输出文字、获取指定区域

    缓存DC的作用:解决闪烁问题 CRect  rect; GetClientRect(rect);获取view视图的区域 CClientDC dc(this); 创建了DC可作图 pdc->Dra ...

  9. webBrowser捕获Alert内容(C#)

    1.引用using mshtml;  //Microsoft HTML Object Library2.[ComVisible(true)] //放到类的上边 public partial class ...

  10. easyui 隔行渐变色属性设置

    1.部分JS文件 function getAgencyDealTable(begin,end,regionFlag,agencyId){ $('#reportList').datagrid({ idF ...