Always empty text field when I validate.

  1. #1

    Always empty text field when I validate.

    Any reason my text field is always found to be EMPTY when it validates, even though I type into the field? This code is from a details window (.ascx custom control) loaded from a .aspx page if that has anything to do with it.

    custom control html...
    <ext:TextField ID="FirstName" runat="server" FieldLabel="First Name" Width="200" IsRemoteValidation="true">
         <RemoteValidation OnValidation="CheckField" />
    </ext:TextField>
    
    
    code behind...
    public void CheckField(object sender, RemoteValidationEventArgs e)
    {
         TextField field = (TextField)sender;
         
         field.Text <--- this is always empty!
    }
    Last edited by chearner; Nov 03, 2011 at 7:35 PM.
  2. #2
    I ran a test and the .Text value appears to be sent properly.

    Example

    <%@ Page Language="C#" %>  
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
      
    <script runat="server">
        public void CheckField(object sender, RemoteValidationEventArgs e)
        {
             TextField field = (TextField)sender;
          
             X.Msg.Notify("Message", field.Text).Show();
        }
    </script>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
    
            <ext:TextField runat="server" FieldLabel="Message" IsRemoteValidation="true">
                <RemoteValidation OnValidation="CheckField" />
            </ext:TextField>
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder
  3. #3
    Fixed it. Stumped me for awhile...

    Since I was loading the page into an iFrame, I needed to wrap this new page into it's own <form> tag.
  4. #4

    better explanation

Similar Threads

  1. Replies: 0
    Last Post: Aug 19, 2011, 12:40 PM
  2. How texboxfiel validate empty space bar?
    By jhohan25 in forum 1.x Help
    Replies: 2
    Last Post: Jun 12, 2011, 11:59 PM
  3. How to validate the value not the text of a combobox
    By charlie_brown in forum 1.x Help
    Replies: 1
    Last Post: Dec 02, 2009, 5:50 PM
  4. Text controls are empty
    By davidhoyt in forum 1.x Help
    Replies: 2
    Last Post: Dec 10, 2008, 5:52 AM
  5. Label with Empty Text
    By Jack in forum 1.x Help
    Replies: 1
    Last Post: Nov 07, 2008, 3:21 AM

Tags for this Thread

Posting Permissions