JQuery to enable,disable textbox is not working consistently
<p>I have a DropDownList as a custom control inserted into a subform which is within a popup window on my main page.  I have coded unique CssClass identifiers for both the DropDownList and the textbox I am trying to enable/disable.  I only want the textbox enabled for DropDownList values 317 and 318, all others should disable the textbox.  Here is the problem... If I bring up my popup window and select an action other than 317/318, it disables the textbox as expected.  Then if I change my mind and select 317 or 318 it DOES NOT enable the textbox.  This seems real strange that it partially works.       </p>

<p>I have the following jquery code in my main page:</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;

     var _CASE_RESERVE_ACTION = "317"; 
     var _LEGAL_RESERVE_ACTION = "318";

     function pageLoad() {

         $(".statusActionDDLCssClass").change(function() {
             var value = $(this).val();
             if (value == _CASE_RESERVE_ACTION || value == _LEGAL_RESERVE_ACTION)
                 $(".statusActionAmountCssClass").attr('enabled', 'enabled');
             else
                 $(".statusActionAmountCssClass").attr('disabled', 'disabled');
         });
     }

&lt;/script&gt;
</code></pre>

<p>Here is the custom control with the DropDownList:</p>

<pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StStatusActionLookup.ascx.cs" Inherits="Company.Solutions.Web.Controls.StStatusActionLookup" %&gt;

&lt;div id="mainControlContainer" style="width:99%; padding:8px;"&gt;

    &lt;div id="comboContainer" style="float:left; padding-top:12px;padding-left:5px; padding-right:5px; padding-bottom:3px;"&gt;
        &lt;asp:UpdatePanel ID="update1" runat="server" UpdateMode="Always"&gt;
            &lt;Triggers&gt;
                &lt;asp:AsyncPostBackTrigger ControlID="chkComments" EventName="CheckedChanged" /&gt;
                &lt;asp:AsyncPostBackTrigger ControlID="chkDenials" EventName="CheckedChanged" /&gt;
                &lt;asp:AsyncPostBackTrigger ControlID="chkOther" EventName="CheckedChanged" /&gt;
            &lt;/Triggers&gt;
            &lt;ContentTemplate&gt;
                &lt;asp:DropDownList runat="server" ID="ddlLookup" width="240px" CssClass="statusActionDDLCssClass" /&gt;
            &lt;/ContentTemplate&gt;
        &lt;/asp:UpdatePanel&gt;

    &lt;/div&gt;
    &lt;div id="filterContainer" style="text-align:left;padding-left:6px;width:275px"&gt;
        &lt;fieldset style="width:260;"&gt;
            &lt;legend&gt;Filters&lt;/legend&gt;
            &lt;asp:CheckBox ID="chkComments" runat="server" Text="Comments" AutoPostBack="true"  /&gt;
            &lt;asp:CheckBox ID="chkDenials" runat="server" Text="Denials" AutoPostBack="true" /&gt;
            &lt;asp:CheckBox ID="chkOther" runat="server" Text="Other" AutoPostBack="true" /&gt;
        &lt;/fieldset&gt;

    &lt;/div&gt;    
&lt;/div&gt;
</code></pre>

<p>And here is my subform with the text box (txtStatusActionAmount):</p>

<pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StatusActionAddSubform.ascx.cs" 
Inherits="Company.Solutions.Web.Controls.StatusActionAddSubform" %&gt;
&lt;%@ Register TagPrefix="st" TagName="StatusActionLookup" Src="~/Controls/StStatusActionLookup.ascx" %&gt;
&lt;div class="NinetyNinePercentWide"&gt;
    &lt;div class="NinetyNinePercentWide EightPixelBottomMargin"&gt;
        &lt;div class="RowHeader" style="padding-top: 20px;"&gt;
            &lt;span&gt;Action:&lt;/span&gt;
        &lt;/div&gt;
        &lt;div&gt;
            &lt;xy:StatusActionLookup ID="statusActionLookup1" runat="server" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="NinetyNinePercentWide EightPixelBottomMargin"&gt;
        &lt;div class="quarterWidthDiv"&gt;
            &lt;span&gt;New Status:&lt;/span&gt;
            &lt;asp:Literal runat="server" Text="&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" ID="spc2" /&gt;
            &lt;asp:DropDownList runat="server" ID="ddlNewStatus"&gt;
                &lt;asp:ListItem Selected="True" Value="" Text="" /&gt;
                &lt;asp:ListItem Value="01" Text="Open" /&gt;
                &lt;asp:ListItem Value="02" Text="Closed" /&gt;
            &lt;/asp:DropDownList&gt;
        &lt;/div&gt;
        &lt;div class="quarterWidthDiv"&gt;
            &lt;span&gt;Date:&lt;/span&gt;
            &lt;asp:Literal runat="server" Text="&amp;nbsp;&amp;nbsp" ID="spc1" /&gt;
            &lt;asp:TextBox ID="txtStatusActionDate" runat="server" Columns="10" MaxLength="10"
            Style="width: 35%;" CssClass="statusActionDate" /&gt;
            &lt;cc1:CalendarExtender ID="txtStatusActionDate_CalendarExtender" runat="server" Enabled="True"
            TargetControlID="txtStatusActionDate" /&gt;
            &lt;cc1:MaskedEditExtender runat="server" ID="txtStatusActionDate_MaskedEditExtender"
            Enabled="True" Mask="99/99/9999" MaskType="Date" TargetControlID="txtStatusActionDate"
            UserDateFormat="MonthDayYear" /&gt;
            &lt;asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtStatusActionDate"
            Type="Date" Operator="DataTypeCheck" ErrorMessage="Invalid Date" &gt;     &lt;/asp:CompareValidator&gt;          
        &lt;/div&gt;
        &lt;div class="quarterWidthDiv"&gt;
        &lt;asp:Label runat="server" ID="lblStatusActionAmount" AssociatedControlID="txtStatusActionAmount"
            Text="Amount:" /&gt;
            &lt;asp:TextBox ID="txtStatusActionAmount" runat="server" Style="width: 30%;" CssClass="statusActionAmountCssClass" /&gt;
        &lt;/div&gt;
        &lt;div class="quarterWidthDiv"&gt;
            &lt;asp:Label runat="server" ID="lblClaimant" AssociatedControlID="ddlClaimant" Text="Claimant:" /&gt;
            &lt;asp:DropDownList ID="ddlClaimant" runat="server" onchange="mailOrStatusActionTextChanged()"&gt;
                &lt;asp:ListItem Selected="True" Value="" Text="" /&gt;
                &lt;asp:ListItem Value="1" Text="Primary" /&gt;
                &lt;asp:ListItem Value="2" Text="Secondary" /&gt;
            &lt;/asp:DropDownList&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div  class="NinetyNinePercentWide EightPixelBottomMargin" style="margin-top: 2px;"&gt;
        &lt;div class="RowHeader"&gt;
            &lt;asp:Label runat="server" ID="lblStatusActionReason" AssociatedControlID="txtStatusActionReason"
            Text="Reason:" /&gt;
        &lt;/div&gt;
        &lt;div style="padding-left: 12px;"&gt;
            &lt;asp:TextBox ID="txtStatusActionReason" runat="server" TextMode="MultiLine" Rows="2"
            MaxLength="25" CssClass="StatusReasonWidth" onchange="mailOrStatusActionTextChanged()" /&gt;
            &lt;asp:CustomValidator ID="cstmValStatusActionReason" runat="server" ControlToValidate="txtStatusActionReason"
            ErrorMessage="String is too long" /&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Thank you,
Jim in Suwanee, GA</p>
