$(document).ready(function() {
$('#password').keyup(function(){
$('#result').html(checkStrength($('#password').val()));
$('#confirmPass').html(confirmPasswordCheck());
});
$('#confirm').keyup(function(){
$('#confirmPass').html(confirmPasswordCheck());
});
$('#password').popover({ html: true,
content: function() {
return $('#passwordInfo').html();
},
placement:"right",
trigger:"focus"
});
});
function checkStrength(password) {
var strength = 0
if (password.length < 6) {
$('#result').removeClass()
$('#result').addClass('short')
return 'Too short'
}
if (password.length > 7) strength += 1
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1
if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
if (strength < 2) {