PDA

View Full Version : [CLOSED] how to allow password least 6 character



hdsoso
May 12, 2013, 2:39 AM
is there an easy way to dothis?


<ext:TextField ID="txtpass" LabelAlign="Right" FieldLabel="密码" runat="server" AllowBlank="false">
<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>

Baidaly
May 13, 2013, 3:49 AM
Hello!

Sorry, what do you mean:

how to allow password least 6 character

You want to set MinLength or MaxLength?

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.field.Text-cfg-minLength
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.field.Text-cfg-maxLength

kavit@bdtpark.com
May 13, 2013, 7:49 AM
Hello!

Sorry, what do you mean:


You want to set MinLength or MaxLength?

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.field.Text-cfg-minLength
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.form.field.Text-cfg-maxLength

Dear
if you use MinLength="6" than
it means at least user has to enter 6 characters

if you MaxLength="6" then
it means user cannot enter more that 6 characters


Example:



<ext:TextField ID="txtPassword"
InputType="Password"
ValidationGroup="CheckLogin"
Width="300"
AllowBlank="false"
MinLength="6"
MsgTarget="Side"
runat="server">
</ext:TextField>

<ext:TextField ID="txtPassword"
InputType="Password"
ValidationGroup="CheckLogin"
Width="300"
AllowBlank="false"
MaxLength="6"
MsgTarget="Side"
runat="server">
</ext:TextField>