get_strengthScore broken?

6 posts, 0 answers
  1. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 13 Nov 2011 Link to this post


    Use the demo sceen->Custom calculated strength score. example..

    Independent of any settings get_strengthScore always returns a exact 5 points per char typed, i.e changing any settinh has zero affect on the score..

  2. O'Man
    O'Man avatar
    34 posts
    Member since:
    Oct 2009

    Posted 14 Nov 2011 Link to this post

    Hi,

    You are corect! But I look the demo but not see code where combo change pasword setting for radtextBox2. Maybe default is 5 points or maybe I needs more glasses.

    Thank,
    Omi
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 14 Nov 2011 Link to this post


    see CalculatingStrength procedure..

    The problem is that var calculatedScore = args.get_strengthScore();
    returns 5 points per char typed independent of weight setting..
    Note not just limited to the demo which only updates the top boxes with changes TextBox1

  5. Edward
    Edward avatar
    13 posts
    Member since:
    Sep 2011

    Posted 15 Nov 2011 Link to this post

    The scores from combos above apply only for the first two TextBoxes and not for this with calculated score.
    So it will remains with the default settings. Probably the idea of the last TextBox is to show that you could calculate the score yourself and show it. You don't need to use get_strengthScore inside the CalculatingStrength function, this is only an example and they didn't want to place huge javascript in the demo I guess.
    I copied the code locally from the demo and set explicitly settings for RadTextBox2. It is working correct after that.

    Cheers,
    ExS
  6. Ray
    Ray avatar
    115 posts
    Member since:
    Mar 2009

    Posted 15 Nov 2011 Link to this post


    The bug with this control is in the init and java code for get_strengthScore
    If you say set up the values, same as the drop boxes for textbox1, or in page_load etc.. nothing will actually happen as the above get_strengthScore function apears to use the default values same as in the demo..

    If one sets these values as part fo the init/definition then the demo code will work..
    Note this is only related to the get_strengthScore funtion usage the other examples will work fine.

    Work around for the bug.. is to init values in aspx page..



  7. O'Man
    O'Man avatar
    34 posts
    Member since:
    Oct 2009

    Posted 17 Nov 2011 Link to this post

    Hi agains

    I use this codes and all shots correctly:

    <script type="text/javascript">
        function CalculatingStrength(sender, args)
        {
           $get("label1").innerHTML = args.get_strengthScore();
        }
    </script>
    <asp:Label Text="" ID="label1" runat="server" />
    <telerik:RadTextBox runat="server" ID="RadTextBox1">
        <PasswordStrengthSettings ShowIndicator="true" OnClientPasswordStrengthCalculating="CalculatingStrength"/>
    </telerik:RadTextBox>

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadTextBox1.PasswordStrengthSettings.PreferredPasswordLength = 10;
            RadTextBox1.PasswordStrengthSettings.MinimumLowerCaseCharacters = 2;
            RadTextBox1.PasswordStrengthSettings.MinimumNumericCharacters = 2;
            RadTextBox1.PasswordStrengthSettings.MinimumSymbolCharacters = 2;
            RadTextBox1.PasswordStrengthSettings.MinimumUpperCaseCharacters = 2;
            RadTextBox1.PasswordStrengthSettings.CalculationWeightings = "50;15;15;20";
            RadTextBox1.PasswordStrengthSettings.RequiresUpperAndLowerCaseCharacters = true;
        }
    }


    When I enter a1B* gets 20 score from length weigh. With a1B*a score is 25 - still casing weigth not met. But after a1B*aB score go 45 coz 6 chars gets 30 and 15 from casing. Continua to  a1B*aB1 go 65 -> 7 lengt = 35 + 15 casing + 15 numbers. Then a1B*aB1* equal 90, 40 for length + 15 casing + 15 numbers + 20 for symbols. And so on.

    Maybe i are not right, but its works liek a rifle.

    Thanks
    Omi
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017