jquery禁用form表单中的文本框
//禁用form表单中所有的input[文本框、复选框、单选框],select[下拉选],多行文本框[textarea]
function disableForm(formId, isDisabled) {
var attr = "disable";
if (!isDisabled) {
attr = "enable";
}
$("form[id='" + formId + "'] :text").attr("disabled", isDisabled);
$("form[id='" + formId + "'] textarea").attr("disabled", isDisabled);
$("form[id='" + formId + "'] select").attr("disabled", isDisabled);
$("form[id='" + formId + "'] :radio").attr("disabled", isDisabled);
$("form[id='" + formId + "'] :checkbox").attr("disabled", isDisabled);
//禁用jquery easyui中的下拉选(使用input生成的combox)
$("#" + formId + " input[class='combobox-f combo-f']").each(function () {
if (this.id) {
alert("input" + this.id);
$("#" + this.id).combobox(attr);
}
});
//禁用jquery easyui中的下拉选(使用select生成的combox)
$("#" + formId + " select[class='combobox-f combo-f']").each(function () {
if (this.id) {
alert(this.id);
$("#" + this.id).combobox(attr);
}
});
//禁用jquery easyui中的日期组件dataBox
$("#" + formId + " input[class='datebox-f combo-f']").each(function () {
if (this.id) {
alert(this.id)
$("#" + this.id).datebox(attr);
}
});
}
jquery禁用form表单中的文本框的更多相关文章
- 在vue中的form表单中下拉框中的数据来自数据库查询到的数据
文章目录 1.实现的效果: 2.前端html代码 3.js中的代码 4.后端的方法 1.实现的效果: 增加一个新的类型到数据库 2.前端html代码 需要注意的部分:prop后边是表单中的字段 v-m ...
- jquery获取form表单中的内容,并将表单内容更新到datagrid的一行
//执行不刷新页面更新所修改的行 var arr = $('#patient_form').serializeArray();//将表单中的数据格式化成数组 var m = new Array(); ...
- JS验证表单中TEXT文本框中是否含有非法字符
<form id="form" action="" method="post"> <input type="hi ...
- 【js】批量判断表单中的文本框非空
方法一: <script type=”text/javascript”> /* * 批量验证表单非空 * 需要非空验证控件的样式class=”mustadd” */ $(".mu ...
- jquery获取form表单中的数据
$(function() { $('#submit').click(function() { var d = {}; var t = $('form').serializeArray(); //t的值 ...
- 如何使用Jquery获取Form表单中被选中的radio值
$("input[name='opType']:checked").val() -------此方法估计用的比较多,通俗易懂 $("input:radio:checke ...
- HTML:让表单、文本框只读,不可编辑的方法
有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使<input type="text" name="input1" value=&qu ...
- AngularJS进阶(三)HTML:让表单、文本框只读,不可编辑的方法
HTML:让表单.文本框只读,不可编辑的方法 有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使<input type="text" name=" ...
- JQuery判断form表单是否为空
功能:通过jquery判断form表单中是否有内容还未填写,如果有未填写的,则阻止提交 $(function () { $('form').bind('submit',function () { / ...
随机推荐
- form 表单模板
<div class="modal-dialog modal-lg"> //大布局modal-lg <div class="modal-content& ...
- android 获取Asset中Properties文件配置的键值对
1 获取 AssetManager AssetManager assetManager = context.getApplicationContext().getAssets(); 2 获取流 Str ...
- POJ - 1942 D - Paths on a Grid
Imagine you are attending your math lesson at school. Once again, you are bored because your teacher ...
- [rancher-net]
ip rule命令 rancher网络全解读 arp命令查询 rancher managed network 实践 docker自定义网桥 iptables增删改查 shell脚本调试技术
- oracle语句录
从表中选出一个某个单位最近的记录 select * from RSDL_SHXX where sbsj in (select max (sbsj) from RSDL_SHXX where DW_ID ...
- prinft he sprintf
四.printf函数 printf函数返回一个格式化后的字符串. 语法:printf(format,arg1,arg2,arg++) 参数 format 是转换的格式,以百分比符号 (“%”) 开始到 ...
- jar安装
安装sdk jar 安装到本地 mvn install:install-file -Dfile=F:\workspace\api-cookbook\java\src\main\lib\sdk-1.10 ...
- Maven3 package时报 'version' contains an expression but should be a constant
父pom文件: <modelVersion>4.0.0</modelVersion> <groupId>com.wey</groupId> <ar ...
- wewqe
script.cscript_runreason(const struct interface *ifp, const char *reason)elen = (size_t)make_env(ifp ...
- 【转载】 深度学习总结:用pytorch做dropout和Batch Normalization时需要注意的地方,用tensorflow做dropout和BN时需要注意的地方,
原文地址: https://blog.csdn.net/weixin_40759186/article/details/87547795 ------------------------------- ...