Miminum password length in textbox
How to validate minimum password length in a textbox in asp.net?
Mininum password length shuold be 6, any keyboard input, character, digits or symbles.
3 Answers
As you said you want to validate only the length then use ValidationExpression="^[\S]{6,50}"
<asp:RegularExpressionValidator ID="revalPassword" runat="server"
ControlToValidate="txtPassword"
Display="Dynamic"
ValidationExpression="^[\S]{6,50}"
ErrorMessage="Min. 6 and max 50 character" />
|
2
|
Answered:
07 Mar 2013
Reputation: 370
|
|
Allow only charact and number
ValidationExpression="^[a-zA-Z0-9\s]{7,10}$"
Allow only characters
ValidationExpression="^[a-zA-Z\s]{7,10}$"
Allow only numbers
ValidationExpression="^[0-9\s]{7,10}$"
|
2
|
Answered:
07 Mar 2013
Reputation: 1,418
|
|
If you want to restring some characters like allow only a - z A - Z 0-9 @ & # then use
ValidationExpression="^[a-zA-Z0-9@&#\s]{6,30}$"
|
1
|
Answered:
07 Mar 2013
Reputation: 133
|
|
This week users
