Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:15:19+00:00 2026-06-05T10:15:19+00:00

I’m using the AjaxControlToolKit’s PasswordStrength control. Once the user begins typing anything into the

  • 0

I’m using the AjaxControlToolKit’s PasswordStrength control. Once the user begins typing anything into the control, it starts displaying a message that the password is weak. I would like this message to appear only after the mininum number of characters have been typed in. I don’t see anything on the control that allows this functionality. Any suggestions on how I should handle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:15:22+00:00Added an answer on June 5, 2026 at 10:15 am

    You are probably going to need to roll your own solution for this which makes sense if you think about it. By hiding the visual cue that a password of two characters is weak but displaying it for a password of three characters would seem to imply that the two character password is sufficient.

    That being said what you might be able to do is write some sort of hack similar to this:

    <script language="javascript">
      function onPasswordChange(textBox) {
          var passwordLabel = document.getElementById([labelID]);
          if(textBox.value.length < [constant]){
              passwordLabel.style.display = 'none';
          }
          else{
              passwordLabel.style.display = 'inline';            
          } 
      }
    </script>
    

    You could then attach this function the controls change onKeyUp or onKeyDown event so that if the length of the password field was less than what you want it to be it will hide the label that contains the message that the strength has not been met. This is untested an only a thought. You may wind up with issue from the toolkit javascript colliding with this script but it is tough to say.

    Additionally the labelID looks to be [controlIDName]_PasswordStrength.

    Edit:

    You would probably want to add the onchange onKeyUp or onKeyDown event to your control like so (code behind):

    control.Attributes.Add(“onchange”, “onPasswordChange(this)”);

     control.Attributes.Add("onKeyDown", "onPasswordChange(this)");
    

    Edit 2:
    As far as hacks go this is pretty messy but it works. Clientside:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <asp:TextBox ID="password" runat="server"></asp:TextBox>
    <div id="PasswordStrengthContainer"></div>
    <asp:PasswordStrength ID="PS" runat="server"
    TargetControlID="password"  
    DisplayPosition="RightSide"  
    StrengthIndicatorType="Text"  
    PreferredPasswordLength="10"  
    PrefixText="Strength:"  
    TextCssClass="TextIndicator_TextBox1"  
    MinimumNumericCharacters="0"  
    MinimumSymbolCharacters="0"  
    RequiresUpperAndLowerCaseCharacters="false"  
    TextStrengthDescriptions="Very Poor;Weak;Average;Strong;Excellent"  
    TextStrengthDescriptionStyles="cssClass1;cssClass2;cssClass3;cssClass4;cssClass5"  
    CalculationWeightings="50;15;15;20"
    />
    
     <script language="javascript">
    
    
    function onPasswordChange(textBox) {
        var passwordLabel = document.getElementById("MainContent_password_PasswordStrength");
        var container = document.getElementById("PasswordStrengthContainer");
    
        if (passwordLabel != null) {
            document.getElementById("PasswordStrengthContainer").appendChild(
                document.getElementById("MainContent_password_PasswordStrength"));
        }
    
        if (textBox.value.length < 4) {
            container.style.display = 'none';
        }
        else {
            container.style.display = 'inline';
        }
    }
     </script>
    

    Serverside:

     password.Attributes.Add("onKeyDown", "onPasswordChange(this)");
     password.Attributes.Add("onBlur", "onPasswordChange(this)");
    

    This code is not efficient and could be cleaned up but works for demonstrative purposes. The javascript function is pretty basic however you will notice this line:

     if (passwordLabel != null) {
            document.getElementById("PasswordStrengthContainer").appendChild(
                document.getElementById("MainContent_password_PasswordStrength"));
        }
    

    Unfortunately the toolkits javascript functions will fire AFTER your function so setting the display to ‘none’ is wiped out by the toolkit. what this code does is remove the label from the page and places it in the div then we merely set the display property of our div to whatever and that will effectively hide the label. There is a singular bug though: when hitting backspace to delete characters the div doesn’t disappear in certain instances. I don’t really have time to track down the issue but it should be trivial for you to clear it up.

    Additionally I was having some problems with onChange in Chrome so opted for onKeyDown instead as @Adriano pointed out above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.