Unchecking checkboxes not of a certain class
<p>I'm trying to work with a multi-select set of checkboxes, but one of the options can be "N/A". If this is checked, I want all others (not having a class of input-na) unchecked. Also, if a non-NA checkbox is checked, I want the NA checkbox unchecked.</p>

<p>I've tried the following, but nothing is happening to the other checkboxes:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function () {
    $("input[type=checkbox].input-na").change(function (event) {
        if ($(this).prop("checked")) {
            $('input[type=checkbox]').not('.input-na').prop('checked', false);
        }
    });

    $("input[type=checkbox]").not(".input-na").change(function (event) {
        if ($(this).prop("checked")) {
            $("input[type=checkbox].input-na").prop("checked", false);
        }
    });
});
</code></pre>

<p></p>

<p>It's getting into both areas with "if ($(this).prop("checked"))" which I've confirmed by putting in alerts, so it's the actual code to uncheck that isn't working.</p>

<p>Edit: Here is the mark-up:</p>

<pre><code>&lt;fieldset data-role="controlgroup"&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[0].key" value="1" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[0].value.ResponseNum" value="1" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[0].value.Text" value="Self service gas, paid at the pump" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[0].value.IsNA" value="False" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_1" value="1" 

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_1"&gt;Self service gas, paid at the pump&lt;/label&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[1].key" value="2" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[1].value.ResponseNum" value="2" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[1].value.Text" value="Self service gas, paid inside at the kiosk or convenience store" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[1].value.IsNA" value="False" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_2" value="2" 

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_2"&gt;Self service gas, paid inside at the kiosk or convenience store&lt;/label&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[2].key" value="3" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[2].value.ResponseNum" value="3" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[2].value.Text" value="Full service provided by attendant" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[2].value.IsNA" value="False" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_3" value="3" 

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_3"&gt;Full service provided by attendant&lt;/label&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[3].key" value="4" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[3].value.ResponseNum" value="4" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[3].value.Text" value="Convenience store purchase (not including gas or diesel)" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[3].value.IsNA" value="False" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_4" value="4" 

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_4"&gt;Convenience store purchase (not including gas or diesel)&lt;/label&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[4].key" value="5" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[4].value.ResponseNum" value="5" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[4].value.Text" value="Car wash" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[4].value.IsNA" value="False" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_5" value="5" 

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_5"&gt;Car wash&lt;/label&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[5].key" value="6" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[5].value.ResponseNum" value="6" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[5].value.Text" value="Washrooms" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[5].value.IsNA" value="False" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_6" value="6" 

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_6"&gt;Washrooms&lt;/label&gt;



    &lt;input type="hidden" name="Questions[0].ResponseOptions[6].key" value="7" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[6].value.ResponseNum" value="7" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[6].value.Text" value="None of the above" /&gt;
    &lt;input type="hidden" name="Questions[0].ResponseOptions[6].value.IsNA" value="True" /&gt;

    &lt;input type="checkbox" name="Questions[0].Responses" id="Question_040179122124101173157046112086076030096242133244_7" value="7" 

                                                                                                        class = "input-na"

    /&gt;
    &lt;label for="Question_040179122124101173157046112086076030096242133244_7"&gt;None of the above&lt;/label&gt;
</code></pre>

<p></p>
