CheckBoxList 선택 항목, 추가 선택 여부 확인

18653 단어
<div class="formControls col-xs-8 col-sm-9" style="margin-top:-15px;" id="divMarket">
            <span class=" hide">
                              
            span>
                
                       <table id="MainContent_rptMarket_chklRegion_0" class="checkBoxList">
    <tr>
        <td><input id="MainContent_rptMarket_chklRegion_0_0_0" type="checkbox" name="ctl00$MainContent$rptMarket$ctl00$chklRegion$0" value="A1AM78C64UM0Y8" /><label for="MainContent_rptMarket_chklRegion_0_0_0">MXlabel>td><td><input id="MainContent_rptMarket_chklRegion_0_1_0" type="checkbox" name="ctl00$MainContent$rptMarket$ctl00$chklRegion$1" value="A2EUQ1WTGCTBG2" /><label for="MainContent_rptMarket_chklRegion_0_1_0">CAlabel>td><td><input id="MainContent_rptMarket_chklRegion_0_2_0" type="checkbox" name="ctl00$MainContent$rptMarket$ctl00$chklRegion$2" value="ATVPDKIKX0DER" /><label for="MainContent_rptMarket_chklRegion_0_2_0">USlabel>td>
    tr>
table><br />
                    
                       <table id="MainContent_rptMarket_chklRegion_1" class="checkBoxList">
    <tr>
        <td><input id="MainContent_rptMarket_chklRegion_1_0_1" type="checkbox" name="ctl00$MainContent$rptMarket$ctl01$chklRegion$0" value="A13V1IB3VIYZZH" /><label for="MainContent_rptMarket_chklRegion_1_0_1">FRlabel>td><td><input id="MainContent_rptMarket_chklRegion_1_1_1" type="checkbox" name="ctl00$MainContent$rptMarket$ctl01$chklRegion$1" value="A1F83G8C2ARO7P" /><label for="MainContent_rptMarket_chklRegion_1_1_1">UKlabel>td><td><input id="MainContent_rptMarket_chklRegion_1_2_1" type="checkbox" name="ctl00$MainContent$rptMarket$ctl01$chklRegion$2" value="A1PA6795UKMFR9" /><label for="MainContent_rptMarket_chklRegion_1_2_1">DElabel>td><td><input id="MainContent_rptMarket_chklRegion_1_3_1" type="checkbox" name="ctl00$MainContent$rptMarket$ctl01$chklRegion$3" value="A1RKKUPIHCS9HS" /><label for="MainContent_rptMarket_chklRegion_1_3_1">ESlabel>td><td><input id="MainContent_rptMarket_chklRegion_1_4_1" type="checkbox" name="ctl00$MainContent$rptMarket$ctl01$chklRegion$4" value="APJ6JRA9NG5V4" /><label for="MainContent_rptMarket_chklRegion_1_4_1">ITlabel>td>
    tr>
table><br />
                    
                       <table id="MainContent_rptMarket_chklRegion_2" class="checkBoxList">
    <tr>
        <td><input id="MainContent_rptMarket_chklRegion_2_0_2" type="checkbox" name="ctl00$MainContent$rptMarket$ctl02$chklRegion$0" value="A1VC38T7YXB528" /><label for="MainContent_rptMarket_chklRegion_2_0_2">JPlabel>td>
    tr>
table><br />
                    
                       <table id="MainContent_rptMarket_chklRegion_3" class="checkBoxList">
    <tr>
        <td><input id="MainContent_rptMarket_chklRegion_3_0_3" type="checkbox" name="ctl00$MainContent$rptMarket$ctl03$chklRegion$0" value="A39IBJ37TRP1C6" /><label for="MainContent_rptMarket_chklRegion_3_0_3">AUlabel>td>
    tr>
table><br />
                    
                       <table id="MainContent_rptMarket_chklRegion_4" class="checkBoxList">
    <tr>
        <td><input id="MainContent_rptMarket_chklRegion_4_0_4" type="checkbox" name="ctl00$MainContent$rptMarket$ctl04$chklRegion$0" value="ATVPDKIKX0DIN" /><label for="MainContent_rptMarket_chklRegion_4_0_4">INlabel>td>
    tr>
table><br />
                             
            div>

 
$(function () {//를 추가할 때 사이트의 설정은 var isAdd =;if (isAdd == 0) {$("#divMarket").find("input").each() {$(this).click () {var currentTable = $(this).parent().parent().parent();if (this.checked ==true) {/$(this).attr()를 선택합니다. "checked", "checked");//선택 속성 추가 var tables = $("#divMarket").find("table"); for(var i = 0; i < tables.length; i++) { if (currentTable.attr("id") != $(tables[i]).attr("id")) { $(tables[i]).find("input").attr("disabled", "true"); } } } else {//not her $(this).removeAttr("checked");//not hecked 선택된 속성 제거 var currentTableInputs = $(currentTable).find("input"); var isNoneChecked = 0; for (var j = 0; j //주의: 선택한 속성과 제거 속성을 추가하지 않으면 $(currentTableInputs[j].attr ("checked") 는 항상 defined if ($(currentTableInputs[j]) 로 값을 지정합니다.attr("checked") == "checked") { isNoneChecked++; break; } } if(isNoneChecked==0) {//선택된 것이 하나도 없습니다. $("input[type='checkbox").each(function(){if($(this).attr("disabled")$(this).removeAttr("disabled");});});};

좋은 웹페이지 즐겨찾기