[CLOSED] Password Validation does not work

  1. #1

    [CLOSED] Password Validation does not work

    according https://examples2.ext.net/#/Form/Tex...rd_Validation/
    and https://examples2.ext.net/#/Form/Tex...Password_Mask/
    I code below
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="extdemo.pages.login" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>用户注册-crm客户关系系统</title>
        <link href="../images/style.css" rel="stylesheet" />
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server">
            </ext:ResourceManager>
    
            <ext:Viewport ID="Viewport1" runat="server">
                <LayoutConfig>
                    <ext:HBoxLayoutConfig Pack="Center"></ext:HBoxLayoutConfig>
                </LayoutConfig>
                <Items>
                    <ext:Panel runat="server" Border="False" Height="900">
                        <LayoutConfig>
                            <ext:VBoxLayoutConfig Pack="Center"></ext:VBoxLayoutConfig>
                        </LayoutConfig>
                        <Items>
                            <ext:Panel runat="server" Border="False">
                                <Content>
                                    <h2 class="hdsoso_title">crm客户关系系统</h2>
                                </Content>
                            </ext:Panel>
                            <ext:TabPanel runat="server" Width="350" ID="ctl344">
    
                                <Items>
                                    <ext:Panel ID="Panel1" runat="server" Title="登陆" BodyPadding="5">
                                        <LayoutConfig>
                                            <ext:HBoxLayoutConfig Pack="Center"></ext:HBoxLayoutConfig>
                                        </LayoutConfig>
                                        <Items>
                                            <ext:Panel
                                                ID="Window1"
                                                runat="server"
                                                Closable="false"
                                                Resizable="false"
                                                Title="用户登陆"
                                                Draggable="false"
                                                Width="330"
                                                BodyPadding="5"
                                                Layout="FormLayout" DefaultButton="btnLogin">
                                                <Items>
                                                    <ext:TextField
                                                        ID="txtUsername"
                                                        runat="server"
                                                        FieldLabel="用户名"
                                                        AllowBlank="false"
                                                        BlankText="请输入用户名">
                                                        <Listeners>
                                                            <AfterRender Handler="#{txtUsername}.focus(false,200);">
                                                            </AfterRender>
                                                        </Listeners>
                                                    </ext:TextField>
                                                    <ext:TextField
                                                        ID="txtPassword"
                                                        runat="server"
                                                        InputType="Password"
                                                        FieldLabel="密码"
                                                        AllowBlank="false"
                                                        BlankText="请输入密码" />
                                                </Items>
                                                <Buttons>
    
                                                    <ext:Button ID="btnLogin" runat="server" Text="登陆" Icon="DoorIn">
                                                        <DirectEvents>
                                                            <Click OnEvent="btnLogin_Click">
                                                                <EventMask ShowMask="true" Msg="正在验证..." MinDelay="500" />
                                                            </Click>
                                                        </DirectEvents>
                                                    </ext:Button>
    
                                                </Buttons>
                                            </ext:Panel>
                                        </Items>
                                    </ext:Panel>
                                    <ext:Panel ID="Panel2" runat="server" Title="注册" BodyPadding="5" Width="330">
                                        <LayoutConfig>
                                            <ext:HBoxLayoutConfig Pack="Center"></ext:HBoxLayoutConfig>
                                        </LayoutConfig>
                                        <Items>
                                            <ext:Panel ID="Window2" runat="server" Layout="FormLayout" Title="用户注册" Width="330" BodyPadding="5">
                                                <Defaults>
                                                    <ext:Parameter Name="LabelWidth" Value="125" Mode="Raw" />
                                                </Defaults>
                                                <Items>
                                                    <ext:TextField ID="txtEmail" FieldLabel="邮箱" runat="server" Vtype="email"></ext:TextField>
                                                    <ext:TextField ID="txtname" FieldLabel="用户名" runat="server"></ext:TextField>
                                                    <ext:TextField ID="txtpass" FieldLabel="密码" runat="server">
                                                        <Plugins>
                                                            <ext:PasswordMask ID="PasswordMask1" runat="server" />
    
                                                            <ext:CapsLockDetector ID="CapsLockDetector1" runat="server">
                                                                <Listeners>
                                                                    <CapsLockOn Handler="#{txtpass}.showIndicator({iconCls : '#Error', tip : '大写锁定已打开'});" />
                                                                    <CapsLockOff Handler="#{txtpass}.hideIndicator();" />
                                                                </Listeners>
                                                            </ext:CapsLockDetector>
                                                        </Plugins>
                                                        <Listeners>
                                                            <ValidityChange Handler="this.next().validate();" />
                                                            <Blur Handler="this.next().validate();" />
                                                        </Listeners>
                                                    </ext:TextField>
                                                    <ext:TextField ID="txtpass1" FieldLabel="确认密码" runat="server" AnchorHorizontal="100%">
                                                        <Plugins>
                                                            <ext:PasswordMask ID="PasswordMask2" runat="server" />
                                                        </Plugins>
                                                        <CustomConfig>
                                                            <ext:ConfigItem Name="initialPassField" Value="txtpass" Mode="Value" />
                                                        </CustomConfig>
                                                    </ext:TextField>
                                                </Items>
                                                <Buttons>
                                                    <ext:Button ID="Button1" runat="server" Text="注册" Icon="UserAdd"></ext:Button>
                                                </Buttons>
                                            </ext:Panel>
                                        </Items>
                                    </ext:Panel>
    
                                </Items>
                            </ext:TabPanel>
                        </Items>
                    </ext:Panel>
                                  
    
    
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    Password Mask works fine, but Password Validation dose not work.
    may I miss something?
    thanks
    Last edited by Daniil; May 14, 2013 at 3:34 AM. Reason: [CLOSED]
  2. #2
    Hello!

    It seems that you forgot set
    Vtype="password"
    <ext:TextField ID="txtpass" FieldLabel="??" runat="server">
    	<Plugins>
    		<ext:PasswordMask ID="PasswordMask1" runat="server" />
    
    		<ext:CapsLockDetector ID="CapsLockDetector1" runat="server">
    			<Listeners>
    				<CapsLockOn Handler="#{txtpass}.showIndicator({iconCls : '#Error', tip : '???????'});" />
    				<CapsLockOff Handler="#{txtpass}.hideIndicator();" />
    			</Listeners>
    		</ext:CapsLockDetector>
    	</Plugins>
    	<Listeners>
    		<ValidityChange Handler="this.next().validate();" />
    		<Blur Handler="this.next().validate();" />
    	</Listeners>
    </ext:TextField>
    <ext:TextField ID="txtpass1" FieldLabel="????" runat="server" AnchorHorizontal="100%" Vtype="password">
    	<Plugins>
    		<ext:PasswordMask ID="PasswordMask2" runat="server" />
    	</Plugins>
    	<CustomConfig>
    		<ext:ConfigItem Name="initialPassField" Value="txtpass" Mode="Value" />
    	</CustomConfig>
    </ext:TextField>
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    It seems that you forgot set
    Vtype="password"
    <ext:TextField ID="txtpass" FieldLabel="??" runat="server">
    	<Plugins>
    		<ext:PasswordMask ID="PasswordMask1" runat="server" />
    
    		<ext:CapsLockDetector ID="CapsLockDetector1" runat="server">
    			<Listeners>
    				<CapsLockOn Handler="#{txtpass}.showIndicator({iconCls : '#Error', tip : '???????'});" />
    				<CapsLockOff Handler="#{txtpass}.hideIndicator();" />
    			</Listeners>
    		</ext:CapsLockDetector>
    	</Plugins>
    	<Listeners>
    		<ValidityChange Handler="this.next().validate();" />
    		<Blur Handler="this.next().validate();" />
    	</Listeners>
    </ext:TextField>
    <ext:TextField ID="txtpass1" FieldLabel="????" runat="server" AnchorHorizontal="100%" Vtype="password">
    	<Plugins>
    		<ext:PasswordMask ID="PasswordMask2" runat="server" />
    	</Plugins>
    	<CustomConfig>
    		<ext:ConfigItem Name="initialPassField" Value="txtpass" Mode="Value" />
    	</CustomConfig>
    </ext:TextField>
    how to custom define the error message "passwords do not match"
    Click image for larger version. 

Name:	QQ截图20130507202328.jpg 
Views:	23 
Size:	27.4 KB 
ID:	6169
  4. #4
    Please set up
    VtypeText="Custom text"
    for a TextField.

Similar Threads

  1. why AjaxProxy dose not run?
    By sclsch in forum 2.x Help
    Replies: 1
    Last Post: Apr 16, 2013, 1:27 AM
  2. Password Validated doesn't work. Please help me.
    By caminoui in forum 2.x Help
    Replies: 1
    Last Post: Sep 07, 2012, 3:57 AM
  3. Implement a Password Meter to a Password Field
    By sudantha in forum 1.x Help
    Replies: 1
    Last Post: Jan 15, 2012, 6:59 AM
  4. [CLOSED] Validation and VTypes - how does it all work?
    By daneel in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 15, 2011, 7:20 AM
  5. FormPanel Validation does not work
    By weiguo526 in forum 1.x Help
    Replies: 0
    Last Post: May 12, 2010, 11:40 AM

Posting Permissions