oziAuth
Version: 3.0.0 — Updated: 2026-05-27
Description
Authentication form validation plugin. Concentrates password, email and confirmation rules in an isolated engine — oziAuth() — and applies real-time visual feedback on fields, rules list and submit button, guiding the user to fill in the correct order.
Examples
[1] Full form with rules list
<input type="email" name="email"
data-ozi-auth-mail
class="form-control"
placeholder="E-mail">
<input type="password" name="password"
data-ozi-auth-pass="bi bi-eye-slash,bi bi-eye"
class="form-control"
placeholder="Password">
<input type="password" name="confirm"
data-ozi-auth-confirm="bi bi-eye-slash,bi bi-eye"
class="form-control"
placeholder="Confirm password">
<div id="passwordRules"></div>
<button type="submit"
data-ozi-auth-submit
data-ozi-auth-list-id="passwordRules"
data-ozi-auth-check="bi bi-circle,bi bi-check2-circle"
class="btn btn-secondary"
disabled>
Save
</button>
[2] With rules dropdown
<input type="password" name="password"
data-ozi-auth-pass="bi bi-eye-slash,bi bi-eye"
class="form-control">
<button type="submit"
data-ozi-auth-submit
data-ozi-auth-dropdown
class="btn btn-secondary"
disabled>
Save
</button>
[3] With username field
<input type="text" name="username"
data-ozi-auth-user
data-ozi-auth-user-caracter="4"
class="form-control"
placeholder="Username">
[4] List + Dropdown simultaneously
<button type="submit"
data-ozi-auth-submit
data-ozi-auth-list-id="passwordRules"
data-ozi-auth-dropdown
class="btn btn-secondary"
disabled>
Save
</button>
<div id="passwordRules"></div>
[5] Validation engine via JavaScript
Use oziAuth() in isolation to validate programmatically:
const result = oziAuth({
mail: 'user@email.com',
password: 'Password@123',
confirm: 'Password@123',
userCaracter: 4
});
if (result.access) {
console.log('✔ All valid — ready to submit!');
} else {
console.log('✘ Errors:', result);
}
Features
- Isolated engine —
oziAuth() validates without depending on the DOM
- Real-time feedback — rules updated on every keystroke
- Show/hide toggle — customizable icons on password fields
- Rules list — rendered in a configurable container
- Rules dropdown — displayed when focusing on the password field
- Count badge — displays real-time progress (
6/14 · 2 remaining)
- Fill order — email validated when typing the password
- Customizable icons — valid/invalid states configurable
HTML Attributes
[1] Fields
| Attribute |
Description |
data-ozi-auth-mail |
Email field — validates format and blocks email parts in password |
data-ozi-auth-pass="iconShow,iconHide" |
Password field — enables show/hide toggle |
data-ozi-auth-confirm="iconShow,iconHide" |
Confirm field — enables show/hide toggle |
data-ozi-auth-user |
Username field — validates minimum length |
data-ozi-auth-user-caracter |
Minimum characters for the username field |
[2] Visual Feedback
| Attribute |
Description |
data-ozi-auth-submit |
Submit button — enabled/disabled based on validation |
data-ozi-auth-list-id="id" |
ID of the container where the rules list will be rendered |
data-ozi-auth-dropdown |
Enables rules dropdown on password fields |
data-ozi-auth-check="iconInvalid,iconValid" |
Icons for rule states — e.g. bi bi-circle,bi bi-check2-circle |
data-ozi-auth-class="classes" |
Replaces the default class on the show/hide button |
[3] Display Rules
| Configuration |
Behavior |
Only data-ozi-auth-submit |
Shows dropdown by default |
Only data-ozi-auth-list-id |
Shows list in the indicated container |
Only data-ozi-auth-dropdown |
Shows dropdown |
data-ozi-auth-list-id + data-ozi-auth-dropdown |
List + dropdown simultaneously |
Validations
Username
- Minimum length defined by
data-ozi-auth-user-caracter
Email
- Valid format:
name@domain.com
Password
| Rule |
Description |
| Length |
Between 8 and 14 characters — real-time badge |
| Lowercase |
At least 1 lowercase letter |
| Uppercase |
At least 1 uppercase letter |
| Number |
At least 1 number |
| Special |
At least 1 special character |
| No spaces |
Must not contain spaces |
| No email parts |
Must not contain email prefix or domain |
Confirmation
- Must be identical to the password
Count Badge
The passLength rule displays real-time progress:
| State |
Display |
| No input |
0/14 |
| Within limit |
6/14 · 2 remaining |
| Limit reached |
8/14 |
| Exceeded |
15/14 · exceeded |
oziAuth() engine return
{
userValid: true, // username meets minimum characters
mailValid: true, // email in valid format
passLength: true, // between 8 and 14 characters
passLowercase: true, // has lowercase letter
passUppercase: true, // has uppercase letter
passNumber: true, // has number
passSpecial: true, // has special character
passNoSpace: true, // no spaces
passNoEmailParts: true, // password does not contain email parts
passConfirm: true, // confirmation matches password
access: true // true only if all rules are met
}
Public API
| Method |
Description |
window.oziAuth(data) |
Isolated validation engine |
window.oziAuthInit($scope) |
Initializes in a scope |
window.oziAuthInitFetched(root) |
Re-initializes after dynamic render |
Usage with dynamic content
// After inserting HTML into the DOM
window.oziAuthInitFetched($('#destination')[0]);
// Or via event
$(document).trigger('oziAuth:initFetched', [rootElement]);