[CLOSED] RemoteValidation with ExtraParams not work

  1. #1

    [CLOSED] RemoteValidation with ExtraParams not work

    In following example I add a ExtraParams in RemoteValidation, but it makes the page cannot show.
    It seems have some javascript error. Is it a bug or I do some thing wrong?
    I have tried if I change the mode of ExtraParams to value then the page is shown, but not work for raw.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script runat="server">    
        protected void vali_txtName(object sender, RemoteValidationEventArgs e)
            {
                e.Success = false;
                e.ErrorMessage = "invalid";
            }
    
    </script>
    
    <!DOCTYPE html>
        
    <html>
    <head id="Head1" runat="server">
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager runat="server" />
                                            <ext:TextField runat="server" ID="txtName" IsRemoteValidation="true" MaxLength="50" EnforceMaxLength="true" Text="Some text here">
                                                    <RemoteValidation OnValidation="vali_txtName">
                                                        <ExtraParams>
                                                            <ext:Parameter Name="Values" Value="#{txtName2}.getValue()" Mode="Raw" />
                                                        </ExtraParams>
                                                    </RemoteValidation>
                                            </ext:TextField>
     
                            <ext:TextField runat="server" ID="txtName2" MaxLength="50" EnforceMaxLength="true" Text="Some text here" />
        </form>
    </body>
    </html>
    Last edited by Daniil; Apr 03, 2014 at 2:47 AM. Reason: [CLOSED]
  2. #2
    Hi @trePjt,

    The second TextFied is not rendered by the time the RemoteValidation section is being built in JavaScript.

    You can use the following instead of the ExtraParams section.
    <RemoteValidation OnValidation="vali_txtName" Before="o.extraParams.Values = #{txtName2}.getValue();">
  3. #3
    It's work. Thank you.

Similar Threads

  1. Replies: 3
    Last Post: Nov 22, 2013, 10:13 PM
  2. Replies: 6
    Last Post: Aug 01, 2011, 4:53 PM
  3. [1.1] RemoteValidation
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 12, 2011, 7:44 AM
  4. RemoteValidation ?
    By nanlinfeixue in forum 1.x Help
    Replies: 0
    Last Post: Jun 20, 2011, 10:49 AM
  5. [CLOSED] RemoteValidation ExtraParams are ignored
    By daneel in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 11, 2011, 3:40 PM

Posting Permissions