adammahri2051
Crypto Influencer
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
400 XP
This tutorial we will teach you how to construct a Password Strength Checker that gives the users feedback as to whether their password has sufficiently met the complexity requirements. A strong password is critical to account security and this tutorial teaches you how to design a system that gauges password strength using jQuery. The user also will be able to click on a check box to see their real password to avoid mistake when typing their desired passwords.
Sample Code
index.php - index.php is for the user interface and for the javascript to create a dialog in the given field.
password_strength.js - is for the inputs of data to make a short dialog and pass to the user interface to create a message to inform the user if their password is weak, good, or strong.
Hope that you learn in this tutorial and enjoy coding. Don't forget to LIKE & SHARE this website.
Download
Sample Code
index.php - index.php is for the user interface and for the javascript to create a dialog in the given field.
- <!
DOCTYPE HTML>
- <
html>
- <
head>
- <
title>
Password Strength Checker</
title>
- <
link
href=
"css/password_strength.css"
rel=
"stylesheet"
type=
"text/css"
/>
- <
script type=
"text/javascript"
src=
"js/jquery-1.10.2.min.js"
>
</script>
- <
script type=
"text/javascript"
src=
"js/password_strength.js"
>
</script>
- </
head>
- <
body>
- <
div id=
"form_wrapper"
>
- <
h1 align=
"center"
>
Password Strength Checker</
h1>
- <
div><
span>
New
Password</
span></
div>
- <
div>
- <
input class
=
"pass-word-field"
type=
"password"
id=
"pass-word"
/>
- <
input class
=
"pass-word-field"
style=
"display:none;"
id=
"pass-word-two"
type=
"text"
/>
- </
div>
- <
div><
span>
Verify New
Password</
span></
div>
- <
div>
- <
input class
=
"verify-password-field"
type=
"password"
id=
"verify-pass-word"
/>
- <
input class
=
"verify-password-field"
style=
"display:none;"
id=
"verify-pass-word-two"
type=
"text"
/>
- </
div>
- <
div style=
"float:right;"
><
span>
Show Password:</
span><
input type=
"checkbox"
id=
"show-hide-passwords"
></
div><
br clear=
"all"
>
- <
div id=
"pass-status"
></
div>
- <
div class
=
"system_buttons"
onClick=
"submit_data();"
>
Submit</
div>
- </
div>
- </
body>
- </
html>
password_strength.js - is for the inputs of data to make a short dialog and pass to the user interface to create a message to inform the user if their password is weak, good, or strong.
- var
pass_word =
$(
'#pass-word'
)
;
- var
verify_password =
$(
'#verify-pass-word'
)
;
- var
password_status =
$(
'#pass-status'
)
;
- password_status.hide
(
)
;
- $(
".pass-word-field"
)
.keyup
(
function
(
e)
- {
- pass_word =
$(
this
)
.attr
(
'id'
)
==
"pass-word"
?
$(
this
)
:
$(
'#pass-word-two'
)
;
- if
(
$(
pass_word)
.val
(
)
==
""
)
- {
- password_status.hide
(
)
;
- return
false
;
- }
- else
- {
- password_status.show
(
)
;
- if
(
very_strong_password.test
(
pass_word.val
(
)
)
)
- {
- password_status.removeClass
(
)
.addClass
(
'very_strong_password'
)
.html
(
"Very strong..."
)
;
- }
- else
if
(
just_strong_password.test
(
pass_word.val
(
)
)
)
- {
- password_status.removeClass
(
)
.addClass
(
'just_strong_password'
)
.html
(
"Strong..."
)
;
- }
- else
if
(
good_password.test
(
pass_word.val
(
)
)
)
- {
- password_status.removeClass
(
)
.addClass
(
'considrate_pass'
)
.html
(
"Good..."
)
;
- }
- else
if
(
weak_password.test
(
pass_word.val
(
)
)
)
- {
- password_status.removeClass
(
)
.addClass
(
'password_is_weak'
)
.html
(
"Still Weak..."
)
;
- }
- else
- {
- password_status.removeClass
(
)
.addClass
(
'weak_password'
)
.html
(
"Very Weak..."
)
;
- }
- }
- }
)
;
Hope that you learn in this tutorial and enjoy coding. Don't forget to LIKE & SHARE this website.
Download
You must upgrade your account or reply in the thread to view hidden text.