www.webdeveloper.com
Results 1 to 2 of 2

Thread: Client not recognizing server changes

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Post Client not recognizing server changes

    I'm farily new web programming. I'm not sure if this is a .Net or javascript question. I have a simple form containing a series of text boxes. In my code behind I'm determining which ones are enabled within the Load event. On the client I'm using jQuery to set focus to the first enabled input.

    This is what I see while debugging... The first field on the page which was disabled on the server is rendered as disabled. So far so good. However, when I look at this fields' disabled attribute it is showing as false. So my jQuery is finding this field as the first enabled input and trying to set focus on it. So it would seem my jQuery is working just fine. Somehow the value of the attribute is not getting set on the client properly even though it displays as disabled.

    I'm afraid maybe I'm just going crazy. Please tell me someone out there has seen something like this before.

    Here is my code.

    aspx
    HTML Code:
    <body>
        <tr style="padding-left: 10px">
            <td valign="top">
                <asp:panel id="pnlModeledIRPMInput" runat="server">
    	            <font class="fdata">
    	                <input id="PropertyModeledIRPM" style="TEXT-ALIGN: right; color: Gray" enableviewstate="true" maxlength="5" size="12" name="PropertyModeledIRPM" tabindex="-1" runat="server"/></font>
    			</asp:panel>
            </td>
            <td valign="top">
                <asp:panel id="Series2InputSection" runat="server">
    			    <font class="fdata">
    			        <input id="PropertyOverrideIRPM" onblur="CheckDecimal(this);" style="TEXT-ALIGN: right"
    				     onfocus="this.select()" enableviewstate="true" maxlength="5" size="12" name="PropertyOverrideIRPM" runat="server"/></font>
                </asp:panel>
            </td>
        </tr>
    </body>
    </html>
    vb code behind

    Code:
    If (<some condition>) Then
        PropertyOverrideIRPM.Disabled = True
    End If
    JavaScript

    Code:
    $(":input:visible:enabled:first")[0].focus();
    I also added this for a sanity check:

    Code:
    var firstInput = document.getElementById("PropertyModeledIRPM").disabled;
    in order to check the value. Still showing as false.

    Any help would be appreciated. Thanks!!
    GRB

  2. #2
    Join Date
    Apr 2009
    Posts
    2
    Correction:

    VB Code Behind

    If (<some condition>) Then
    PropertyModeledIRPM.Disabled = True
    End If

    Sorry about that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles