check or not to check
<p>I need a little bit help. Here is my url : <a href="http://fuzzysiberians.com/cfm/testRT.cfm" rel="nofollow">http://fuzzysiberians.com/cfm/testRT.cfm</a></p>

<p>First, the Final check box should not be available until all of the task (1-8) boxes are checked. Second, the bills paid should not be available until final box is checked. </p>

<p>I have couple problems.</p>

<ol>
<li>I check all of the taks. Then, I check final. If I uncheck any of the tasks, the final should be unchecked and disabled. The bills paid should also be unchecked and disabled. 
For some reason, I cannot remove ID-9 (final) and ID-10 (bills paid) from my jtIDList. </li>
</ol>

<p>I will really appreciate if somebody can point what I am doing wrong.</p>

<p>thanks</p>

<pre><code>        &lt;link rel="stylesheet" type="text/css" href="css/jqModal.css"&gt;
    &lt;script type="text/javascript" src="javascript/jquery-1.4.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="javascript/jqModal.js" &gt;&lt;/script&gt;        
    &lt;script type="text/javascript" src="javascript/jquery.form.js" &gt;&lt;/script&gt;
    &lt;script&gt;
    $().ready(function() {

        $('#jqmInvoice').jqm({modal: true, 
                      onHide: function(h) {
                          h.w.slideUp("fast",function() { if(h.o) h.o.remove(); }); 
                           $('#jobTypes-10').attr('checked',false);
                      },
                      trigger: false});

        $('#jqmReadyCheck').jqm({modal: true, 
                                 onHide: function(h) {
                                 /* callback executed on window hide. Hide notice, overlay. */
                                   h.w.slideUp("fast",function() { if(h.o) h.o.remove(); }); 
                                $('#jobTypes-9').attr('checked',false);
                                $('#chk-10').attr('disabled', true);
                                $('#desc-10').css('color','gray');
                                },                            
                                trigger: false});

        var arr = [];    


            $('#jobTypes-9').attr('disabled', true);
            $('#jobTypes-9').attr('checked',false);
            $('#desc-9').css('color','#ccc');





            $('#jobTypes-10').attr('disabled', true);
            $('#desc-10').css('color','#ccc');


        $("input[type=checkbox][checked]").each(function() {
            var jtID = $(this).val();
            var inx = $.inArray(jtID, arr);
            if(inx == -1) {
                arr.push(jtID);
            }
            $("#jtIDList").val(arr);
            isReady(arr);
        });

        $("input[type=checkbox]").click(function() {
            var jtID = $(this).val();
            $('#jtIDVal').val(jtID);
            var inx = $.inArray(jtID, arr);
            if (!$(this).is(':checked')) {
                arr.splice(inx,1);
                arr.splice($.inArray(9,arr),1);
                //arr.splice($.inArray(10,arr),1);

                $("#jtIDList").val(arr);
            } else {
                if( inx == -1) {
                    arr.push(jtID);
                    $("#jtIDList").val(arr);    
                }
                if ( jtID == 10 ) {
                    $('#jqmInvoice').jqmShow().css('left',100).css('top',150); 
                }

            }

            isReady(arr);

        });

        function isReady(arr) {
            $('#image').html('jtIDList length:'+arr.length);
            if(arr.length &lt; 8) {
                $('#desc-9').css('color','#ccc');
                $('#jobTypes-9').attr('checked',false);
                $('#jobTypes-9').attr('disabled', true);

                $('#jobTypes-10').attr('checked',false);
                $('#jobTypes-10').attr('disabled', true);
                $('#desc-10').css('color','#ccc');
            } else {
                $('#desc-9').css('color','#000');
                $('#jobTypes-9').attr('disabled', false);
            }
        }

        $('#jobTypes-9').click(function() {
            if ( $(this).is(':checked') ) {
                $('#jobTypes-10').attr('disabled', false);
                $('#desc-10').css('color','#000');
            } else {
                $('#jobTypes-10').attr('checked',false);
                $('#jobTypes-10').attr('disabled', true);
                $('#desc-10').css('color','#ccc');
            }
        });



     });
    &lt;/script&gt;

    &lt;form id="rtForm" name="rtForm" method="post" action=""&gt;
    userid: &lt;input type="text" name="unid" id="unid" value="2990" /&gt;&lt;br/&gt;
    IDList:&lt;input type="text" name="jtIDList" id="jtIDList" value="" /&gt; &lt;br/&gt;
    selected jtID:&lt;input type="text" name="jtIDVal" id="jtIDVal" value="" /&gt; &lt;br/&gt;        
    pjtIDList:&lt;input type="text" name="pjtIDList" id="pjtIDList" value="2,3,6" /&gt;&lt;br/&gt; 
    &lt;div style="float:left; padding-left:10px;"&gt;
    &lt;table border="0" width="100%" align="center"&gt;

        &lt;tr&gt;&lt;td colspan="2"&gt;&lt;div id="image"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;
              &lt;td align="left" id="desc-1"  width="90" class="refTbl" &gt;
                  Task 1
              &lt;/td&gt;
              &lt;td align="left" id="chk-1" width="40" class="refTbl"&gt;
               &lt;input type="checkbox" name="jobTypes" id="jobTypes-1" value="1"   /&gt;
              &lt;/td&gt;

              &lt;td width="30"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td align="left" id="desc-2"  width="90" class="refTbl" &gt;
                  Task 2 
              &lt;/td&gt;
              &lt;td align="left" id="chk-2" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-2" value="2" checked="checked"  /&gt;
              &lt;/td&gt;
        &lt;/tr&gt;  
        &lt;tr&gt;
              &lt;td align="left" id="desc-3"  width="90" class="refTbl" &gt;
                  Task 3
              &lt;/td&gt;
              &lt;td align="left" id="chk-3" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-3" value="3" checked="checked"  /&gt;
              &lt;/td&gt;

              &lt;td width="30"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td align="left" id="desc-4"  width="90" class="refTbl" &gt;
                  Task 4
              &lt;/td&gt;
              &lt;td align="left" id="chk-4" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-4" value="4"   /&gt;
              &lt;/td&gt;
        &lt;/tr&gt;  

        &lt;tr&gt;
              &lt;td align="left" id="desc-5"  width="90" class="refTbl" &gt;
                  Task 5
              &lt;/td&gt;
              &lt;td align="left" id="chk-5" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-5" value="5"   /&gt;
              &lt;/td&gt;

              &lt;td width="30"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td align="left" id="desc-6"  width="90" class="refTbl" &gt;
                  Task 6
              &lt;/td&gt;
              &lt;td align="left" id="chk-6" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-6" value="6" checked="checked"  /&gt;
              &lt;/td&gt;
        &lt;/tr&gt;  

        &lt;tr&gt;
              &lt;td align="left" id="desc-7"  width="90" class="refTbl" &gt;
               Task 7
              &lt;/td&gt;
              &lt;td align="left" id="chk-7" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-7" value="7"   /&gt;
              &lt;/td&gt;

              &lt;td width="30"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td align="left" id="desc-8"  width="90" class="refTbl" &gt;
                  Task 8
              &lt;/td&gt;
              &lt;td align="left" id="chk-8" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-8" value="8"   /&gt;
              &lt;/td&gt;
        &lt;/tr&gt;  

        &lt;tr&gt;
              &lt;td align="left" id="desc-9"  width="90" class="refTbl" &gt;
                  Final
              &lt;/td&gt;
              &lt;td align="left" id="chk-9" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-9" value="9"   /&gt;
              &lt;/td&gt;

              &lt;td width="30"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td align="left" id="desc-10"  width="90" class="refTbl" &gt;
                  Bills Paid
              &lt;/td&gt;
              &lt;td align="left" id="chk-10" width="40" class="refTbl"&gt;
                  &lt;input type="checkbox" name="jobTypes" id="jobTypes-10" value="10"   /&gt;
              &lt;/td&gt;
        &lt;/tr&gt;  
    &lt;/table&gt; 
    &lt;/div&gt;
    &lt;div style="clear:both;"&gt;&lt;/div&gt;
    &lt;div id="formSub" align="right" style="padding-right:20px;"&gt;
        &lt;input type="submit" name="btnSaveRT" id="btnSaveRT" class="submitButton save" value="Save" style="margin-left:20px;"/&gt;
    &lt;/div&gt;
    &lt;/form&gt;

&lt;div id="jqmInvoice" class="jqmWindow" style="width:430px; display:none;"&gt;
&lt;div class="jqmHeader" &gt;
    &lt;div id="jqmInvoiceTitle" style="margin-top:10px;"&gt;Confirmation for Paid Bills&lt;/div&gt;
    &lt;div id="jqmHeaderClose" style="margin-top:-10px;" &gt;
        &lt;img src="images/vista-close.gif" class="jqmClose" alt="close" /&gt;
    &lt;/div&gt;
    &lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;/div&gt;
     &lt;div class="jqmBody"&gt;
     &lt;div class="jqmConfirmContent"&gt;
       &lt;div style="float:left; padding-top:20px;"&gt;
              &lt;img src="images\warning.gif" /&gt;
       &lt;/div&gt;
       &lt;div style="float:left; padding-left:20px; width:300px;"&gt;
           &lt;p class="jqmConfirmMsg"&gt;
           This will notify the bank that all bills have been paid. 
           &lt;/p&gt;
           &lt;p&gt;Do you wish to continue?&lt;/p&gt;
       &lt;/div&gt;
       &lt;div style="clear:both; height:10px;"&gt;&lt;/div&gt;
    &lt;/div&gt;
        &lt;div style="padding-left:52px;"&gt;
        &lt;input type="submit" name="btnNo"  id="btnNo"  class="submitButton no"  value="NO" /&gt;
        &lt;input type="submit" name="btnYes" id="btnYes" class="submitButton yes" value="YES" style="margin-left:50px;" /&gt;
    &lt;/div&gt;
    &lt;div style="height:20px;"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="jqmFooter jqmFooterButtons" id="jqmFooterText"&gt;
     &lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;
        $('#btnNo').click(function() {
    $('#jqmInvoice').jqmHide();        
    $('#jobTypes-10').attr('checked',false);
    $('#formSub').html('&lt;input type="submit" name="btnSaveRT" id="btnSaveRT" class="submitButton save" value="Save" style="margin-left:20px;"/&gt;');
});
$('#btnYes').click(function() {
    $('#jqmInvoice').jqmHide();
    $('#jobTypes-10').attr('checked',true);
});                               
</code></pre>

<p></p>
