zoukankan      html  css  js  c++  java
  • 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);
    }
    });
    }

  • 相关阅读:
    bug排查
    做接口测试没反应
    wcf配置文件
    mvc学习-编辑提交需要注意-mvc重点
    大批量导出思路
    进程基础知识
    (转)JMS事务
    (转)JMS简明学习教程
    (转)Linux下使用system()函数一定要谨慎
    LInux文件基础知识和文件目录操作(二)文件I/O操作
  • 原文地址:https://www.cnblogs.com/ryanlamp/p/8336228.html
Copyright © 2011-2022 走看看