SAPO::Widget.Passwordmeter->set
This method will show a password strength in a meter.
Syntax
var myPasswdMeter = new SAPO.Widget.Passwordmeter({<options>});
myPasswdMeter.set(<password string>);
Compatibility
| All browsers | Yes |
Depends
Input Parameters
- (object) options : Optional options
Options
- meter: (string) type of meter. Can be: slide, points, text - (default: slide)
- elmMeter: (string) Element ID to move in slide meter
- elmParentMeter: (string) Element ID that contains all points in points meter.
- classNameMeter: (string) Points Classname. To use in points meter.
- elmText: (string) Element ID to write password strength in text meter.
- textCallBack: (function) Callback function to use optionally in text meter.
- callBack: (function) Callback function to use optionally, for now, in points meter. Accept an argument. Will be password security 0 - 100
Sample
http://js.sapo.pt/SAPO/Widget/Passwordmeter/sample/
Example
<input type="password" id="passwd_field" value="" onkeyup="myPasswdMeter.set(this.value);" />
<div id="points_content">
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
<div class="points" style="width:5px;height:5px;margin:1px; float:left;"></div>
</div>
<script type="text/javascript">
var options = {
meter:'points',
elmParentMeter:'points_content',
classNameMeter:'points'
};
var myPasswdMeter = new SAPO.Widget.Passwordmeter(options);
</script>
Community feedback