PDA

View Full Version : Password Strength Implementation ExtJS



dhruvakrishnan
27 Jun 2011, 3:27 AM
I was looking at password strength implementations with ExtJS and came across this particular implementation,

A password strength meter for passwords for ExtJS4. (http://www.simoens.org/Ext.plugin.extjs.form.PasswordStrength/)

This is implemented using ExtJS 4 and i was looking to use it with ExtJS 3. I tried a few options, but couldn't figure out much.

Please let me know if there is something specific i need to do in order to get it working with ExtJS 3.

Here is the plugin source code (https://github.com/mitchellsimoens/Ext.plugin.extjs.form.PasswordStrength/blob/master/Ext.plugin.extjs.form.PasswordStrength.js) for this and the HTML is below.


<script type="text/javascript">
Ext.apply(Ext.form.VTypes, {
strength: function(val, field) {
return field.score > field.strength;
},
strengthText: "Password is not strong enough"
});
Ext.require([
"Ext.form.*"
]);
Ext.onReady(function() {
var form = Ext.create("Ext.form.FormPanel", {
renderTo : Ext.getBody(),
width : 300,
title : "Password Strength Plugin",
defaultType : "textfield",
defaults : {
anchor : "99%",
msgTarget : "side"
},
items : [
{
fieldLabel : "Username"
},
{
fieldLabel : "Password",
inputType : "password",
vtype : "strength",
strength : 24,
plugins : {
ptype : "passwordstrength"
}
}
]
});
});
</script>

dmackerman
27 Jun 2011, 12:02 PM
I replied to your thread on StackOverflow. :)

dhruvakrishnan
27 Jun 2011, 12:17 PM
Thank you very much :)