Enable/Disable form elements based on dropdown list
<p>So I have been looking around at questions on here and I have gotten far enough to be able to disable a <code>textbox</code> by changing the selection of the <code>dropdownlist</code>, but I want to be able to enable it again if the <code>dropdownlist</code> goes back to its default value of <code>&lt;Select an Access Point&gt;</code>.  </p>

<p>JQuery: </p>

<pre><code>$('#selectAccessPoint').change(function () {
    if ($('#selectAccessPoint :selected').val != "2147483647")
        $('#newAccessPoint').attr('disabled', 'disabled');
    else {
        $('#newAccessPoint').removeAttr('disabled');
        $('#newAccessPoint').attr('enabled', 'enabled');
    }
});
</code></pre>

<p>HTML for <code>textbox</code> and <code>dropdownlist</code>:
`</p>

<pre><code>        &lt;tr&gt;
        &lt;td&gt;&lt;label for ="AccessPoint" class="xl"&gt;Access Point:&lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;%= Html.DropDownListFor(x =&gt; x.AccessPointsList.Id, Model.AccessPointsList.AccessPoints.OrderByDescending(x =&gt; x.Value.AsDecimal()), new { @id = "selectAccessPoint", @class = "info1"})%&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;label for ="AccessPoint" class="xl"&gt;Or Add New:&lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;%= Html.TextBoxFor(x =&gt; x.AccessPointsList.AccessPoint, new { @id = "newAccessPoint", @class = "location info2 xl", maxlength = "250" }) %&gt;&lt;/td&gt;
        &lt;/tr&gt;
</code></pre>

<p>Generated HTML:
<code>&lt;select class="info1" data-val="true" data-val-number="The field Id must be a number." data-val-required="The Id field is required." id="selectAccessPoint" name="AccessPointsList.Id"&gt;&lt;option value="2147483647"&gt;&amp;lt;Select an Access Point&amp;gt;&lt;/option&gt;</code>
(there are more options in there but this is the one I am comparing against)</p>

<p><code>&lt;input class="location info2 xl" id="newAccessPoint" maxlength="250" name="AccessPointsList.AccessPoint" type="text" value=""&gt;</code></p>

<p>Notes: <code>attr</code> must be used as <code>prop</code> gives me an error and <code>val()</code> also gives me an error.  </p>
