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

  • 相关阅读:
    poj1743Musical Theme
    poj1743Musical Theme
    poj2774最长公共子序列(后缀数组)
    病毒侵袭
    阿狸的打字机(AC自动机+fail树)
    阿狸的打字机(AC自动机+fail树)
    bzoj3172 AC自动机+fail树
    HDU2222(AC自动机)
    HDU2222(AC自动机)
    _itoa进制转换
  • 原文地址:https://www.cnblogs.com/ryanlamp/p/8336228.html
Copyright © 2011-2022 走看看