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. Problem F: 深入浅出学算法007-统计求和

    Description 求含有数字a且不能被a整除的4位整数的个数,并求这些整数的和 Input 多组测试数据,先输入整数T表示组数然后每组输入1个整数a(1<=a<=9) Output ...

  2. BeanFactoryPostProcessor和BeanPostProcessor

    1. BeanFactoryPostProcessor调用(见AbstractApplicationContext.refresh): >> 创建DefaultListableBeanFa ...

  3. leetcode132. Palindrome Partitioning II

    leetcode132. Palindrome Partitioning II 题意: 给定一个字符串s,分区使分区的每个子字符串都是回文. 返回对于s的回文分割所需的最小削减. 例如,给定s =&q ...

  4. MYSQL学习笔记 (四)GROUP BY与HAVING用法

    注意:select 后的字段,必须要么包含在group by中,要么包含在having 后的聚合函数里. 1. GROUP BY 是分组查询, 一般 GROUP BY 是和聚合函数配合使用 group ...

  5. PHP 基础函数(一)数组的键名和值

    array_values($arr);  获取数组的值,键名消失,原数组不变,返回转变后的数组:

  6. 动软代码生成器连接Oracle 11g

      首先要说明的是:如果你连接的是远程的Oracle服务器,你本地机器必须装Oracle客户端,然后 用sqldeveloper 先建立一个连接. 然后你才能用.NET动软代码生成器连接到数据库. 因 ...

  7. li 标签中放a 标签,文字垂直居中

    <ul style="float:left"><li class="lili"> <a href="Left.aspx? ...

  8. Extjs下拉树代码测试总结

    http://blog.csdn.net/kunoy/article/details/8067801 首先主要代码源自网络,对那些无私的奉献者表示感谢! 笔者对这些代码做了二次修改,并总结如下: Ex ...

  9. POJ 2417 Discrete Logging (Baby-Step Giant-Step)

    Discrete Logging Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 2819   Accepted: 1386 ...

  10. mysql-connector-odbc-8.0.11-winx64.msi安装失败

    mysql-connector-odbc-8.0.11-winx64.msi安装失败 提示需要Redistributable for Visual Studio 2015 去下载 vc_redist. ...