Muhammad Abdul Qaium is a Database Engineer/Oracle Apex Developer/BI Developer (in Connecticut, USA) who is an Oracle Certified Cloud Architect Professional, OCI Autonomous DB specialist as well as Oracle Business Intelligence Foundation Suite 11g Certified Implementation Specialist with extensive expertise in Database design , PL/SQL, Oracle Apex, Microsoft SSIS, ETL, Power BI, Qlik Sense, BI Publisher, Jasper Report, OBIEE. Contact: qaiuminfo@gmail.com
Search This Blog
Thursday, August 9, 2018
Password Strength Check In Oracle Apex
Step 1:- Post Text
<span id="password_strength"></span>
Step 2:- Custom Attributes
onkeyup="CheckPasswordStrength(this.value)"
Step 3:- Function and Global Variable Declaration
function CheckPasswordStrength(password) {
var password_strength = document.getElementById("password_strength");
//TextBox left blank.
if (password.length == 0) {
password_strength.innerHTML = "";
return;
}
//Regular Expressions.
var regex = new Array();
regex.push("[A-Z]"); //Uppercase Alphabet.
regex.push("[a-z]"); //Lowercase Alphabet.
regex.push("[0-9]"); //Digit.
regex.push("[$@$!%*#?&]"); //Special Character.
var passed = 0;
//Validate for each Regular Expression.
for (var i = 0; i < regex.length; i++) {
if (new RegExp(regex[i]).test(password)) {
passed++;
}
}
//Validate for length of Password.
if (passed > 2 && password.length > 8) {
passed++;
}
//Display status.
var color = "";
var strength = "";
switch (passed) {
case 0:
case 1:
strength = "Weak";
color = "red";
break;
case 2:
strength = "Good";
color = "darkorange";
break;
case 3:
case 4:
strength = "Strong";
color = "green";
break;
case 5:
strength = "Very Strong";
color = "darkgreen";
break;
}
password_strength.innerHTML = strength;
password_strength.style.color = color;
}
Subscribe to:
Post Comments (Atom)
Confirmation Alert Before Submit / Conditional Button execution using one button JavaScript in Oracle Apex
Using below code you can take a confirmation before execution even you can do conditional button press and execution. apex.message.confirm( ...
-
Search by keyword from Oracle Database Objects. select owner, type, name, line, text from dba_source where 1 = 1 and text like '%TEXT Y...
-
We Can Export Application Components individually from Oracle Apex. Application > Shared Components > Export Application Compo...
No comments:
Post a Comment