zoukankan      html  css  js  c++  java
  • 复选框的实现

    relationDateCheck方法 放在Onload之中
    一.roll 12补丁之后 IE9
    function relationDateCheck() {
    var PL = crmForm.all.new_allowrelationdate;
    var PLV = crmForm.all.new_checkallowrelation;


    PL.style.display = "none";
    PLV.style.display = "none";

    // Create a DIV container
    var addDiv = document.createElement("div");
    addDiv.setAttribute("style", "overflow-y:auto; height:40px;border: 1px #00000 solid;background-color: #ffffff;");
    PL.parentNode.appendChild(addDiv);

    // Initialise checkbox controls
    for (var i = 1; i < PL.options.length; i++) {
    var pOption = PL.options[i];

    var addInput = document.createElement("input");
    addInput.setAttribute("type", "checkbox");
    addInput.setAttribute("name", "test");
    addInput.setAttribute("onclick", "getRelationDateValue()");
    addInput.setAttribute("style", "border:none; 25px; align:left;");

    if (IsRelationDateChecked(pOption.text, PLV)) {
    addInput.setAttribute("checked", "checked");
    }

    var addLabel = document.createElement("labal");
    addLabel.innerText = pOption.text;

    PL.nextSibling.appendChild(addInput);
    PL.nextSibling.appendChild(addLabel);
    }
    }
    // Check if it is selected
    function IsRelationDateChecked(pText, PLV) {

    if (PLV.value != "") {
    var PLVT = PLV.value.split(";");
    for (var i = 0; i < PLVT.length; i++) {
    if (PLVT[i] == pText)
    return true;
    }
    }
    return false;
    }

    function getRelationDateValue() {
    var PL = crmForm.all.new_allowrelationdate;
    var pick = crmForm.all.new_checkallowrelation;
    var value = "";
    var getInput = PL.nextSibling.getElementsByTagName("input");
    for (var i = 0; i < getInput.length; i++) {
    if (getInput[i].checked) {
    value += getInput[i].nextSibling.innerText + ";";
    }
    }
    Xrm.Page.getAttribute("new_checkallowrelation").setValue(value);
    }

  • 相关阅读:
    CentOS 6.3下部署LVS(NAT)+keepalived实现高性能高可用负载均衡
    三大WEB服务器对比分析(apache ,lighttpd,nginx)
    linux sudo 命令
    linux 添加用户、权限
    LeetCode——Find Largest Value in Each Tree Row
    LeetCode——Single Element in a Sorted Array
    LeetCode——Find All Duplicates in an Array
    LeetCode—— Partition Equal Subset Sum
    LeetCode——Unique Binary Search Trees II
    LeetCode——Is Subsequence
  • 原文地址:https://www.cnblogs.com/z1984/p/2948035.html
Copyright © 2011-2022 走看看