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);
    }
    });
    }

  • 相关阅读:
    C# 检测dll的新版本号方法
    DataGridView 单击赋值
    一致性Hash算法
    .net Parallel并行使用注意事项
    析构函数和Dispose方法的区别
    查看SQLServer的最大连接数
    Hash算法-CityHash算法
    Hash算法
    Sunday算法--C#版
    KMP算法--C#版
  • 原文地址:https://www.cnblogs.com/ryanlamp/p/8336228.html
Copyright © 2011-2022 走看看