[CLOSED] DateField : Validation Not Working

  1. #1

    [CLOSED] DateField : Validation Not Working

    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
        <script>
            var onKeyUp = function () {
    
                var me = this,
                    v = me.getValue(),
                    field;
    
                if (me.startDateField) {
                    field = Ext.getCmp(me.startDateField);
                    field.setMaxValue(v);
                    me.dateRangeMax = v;
                } else if (me.endDateField) {
                    field = Ext.getCmp(me.endDateField);
                    field.setMinValue(v);
                    me.dateRangeMin = v;
                }
    
                field.validate();
            };
        </script>
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <ext:DateField runat="server" ID="txtdateFrom" FieldLabel="From" LabelAlign="Left" LabelWidth="40" Vtype="daterange" EnableKeyEvents="true" Format="dd-MM-yyyy" AllowBlank="false">
                            <Listeners>
                                <%--<AfterRender Handler="this.setValue(getInformationfromuserinfoCookies()[0])"></AfterRender>--%>
                                <KeyUp Fn="onKeyUp"></KeyUp>
                            </Listeners>
                            <CustomConfig>
                                <ext:ConfigItem Name="endDateField" Value="#{txtdateTo}" Mode="Raw"></ext:ConfigItem>
                            </CustomConfig>
                        </ext:DateField>
                       
    
                        <ext:DisplayField runat="server" Html="&nbsp;" PaddingSpec="0 0 0 10"></ext:DisplayField>
                        <ext:DateField runat="server" ID="txtdateTo" FieldLabel="To" LabelAlign="Left" LabelWidth="40" Vtype="daterange" EnableKeyEvents="true" Format="dd-MM-yyyy" AllowBlank="false">
                            <Listeners>
                               <%--<AfterRender Handler="this.setValue(getInformationfromuserinfoCookies()[1])"></AfterRender>
                                <KeyUp Fn="onKeyUp"></KeyUp>--%>
                            </Listeners>
                     </ext:DateField>
    
    </asp:Content>
    with above code date range validation not working .not found any java script error .please help.
    Last edited by Daniil; Apr 09, 2015 at 10:08 AM. Reason: [CLOSED]
  2. #2
    Hi @matrixwebtech,

    Please follow:
    http://forums.ext.net/showthread.php...l=1#post112357
  3. #3
    Thanks ,problem solved.it will be nice if you put some light and explain whats going wrong and what is special in
    <ext:ConfigItem 
        Name="endDateField" 
        Value="<%# DateField2.ConfigID %>" 
        Mode="Value" 
        AutoDataBind="true" />
  4. #4
    This post explains the problem.

    #{ControlID} renders Namespace.ConfigId.
    <%# DateField2.ConfigID %> renders only ConfigId.

    VType="daterange" retrieves a component via Ext.getCmp(). It fails with Namespace.ConfigId.
  5. #5
    Thanks ,Please close the thread.

Similar Threads

  1. [CLOSED] DateField with DateRange Validation
    By RCN in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 03, 2014, 11:30 AM
  2. [CLOSED] Change validation text for DateField
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 30, 2013, 2:03 AM
  3. [CLOSED] Datefield validation
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 03, 2010, 1:01 PM
  4. [CLOSED] Validation of DateField
    By macap in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 11, 2010, 11:29 AM
  5. Validation for DateField
    By n_s_adhikari@rediffmail.com in forum 1.x Help
    Replies: 2
    Last Post: Sep 09, 2009, 5:00 PM

Posting Permissions