|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | + |
| 4 | +<head> |
| 5 | + <meta charset="utf-8"> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | + |
| 8 | + <title>Bootstrap 5 Password Strength Meter Example - Rule Options</title> |
| 9 | + <link href=" https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel=" stylesheet" |
| 10 | + integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> |
| 11 | +</head> |
| 12 | + |
| 13 | +<body> |
| 14 | + <div class="container mt-2"> |
| 15 | + <h1>Bootstrap 5 Password Strength Meter Example - Rule Options</h1> |
| 16 | + <form role="form" class="my-5"> |
| 17 | + <div class="row" id="pwd-container"> |
| 18 | + <div class="col-sm"> |
| 19 | + <label for="password" class="form-label">Password</label> |
| 20 | + <input type="password" class="form-control" id="password" placeholder="Password"> |
| 21 | + </div> |
| 22 | + <div class="col-sm pt-5"> |
| 23 | + <div class="pwstrength_viewport_progress"></div> |
| 24 | + </div> |
| 25 | + </div> |
| 26 | + <div class="row"> |
| 27 | + <div id="messages" class="col small text-muted"></div> |
| 28 | + </div> |
| 29 | + </form> |
| 30 | + <pre>jQuery(document).ready(function () { |
| 31 | + "use strict"; |
| 32 | + var options = {}; |
| 33 | + options.rules = { |
| 34 | + activated: { |
| 35 | + wordTwoCharacterClasses: true |
| 36 | + }, |
| 37 | + specialCharClass: "[!,@,#,$,%,^,&,*,?,_,~,+]" |
| 38 | + }; |
| 39 | + options.ui = { |
| 40 | + container: "#pwd-container", |
| 41 | + viewports: { |
| 42 | + progress: ".pwstrength_viewport_progress" |
| 43 | + }, |
| 44 | + showVerdictsInsideProgressBar: true |
| 45 | + }; |
| 46 | + options.common = { |
| 47 | + debug: true, |
| 48 | + onLoad: function () { |
| 49 | + $('#messages').text('Start typing password'); |
| 50 | + } |
| 51 | + }; |
| 52 | + $(':password').pwstrength(options); |
| 53 | +});</pre> |
| 54 | + <p><a href="..">Go back</a></p> |
| 55 | + </div> |
| 56 | + |
| 57 | + <script src="https://code.jquery.com/jquery-3.6.0.min.js" |
| 58 | + integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> |
| 59 | + <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" |
| 60 | + integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4" |
| 61 | + crossorigin="anonymous"></script> |
| 62 | + <script type="text/javascript" src="../pwstrength.js"></script> |
| 63 | + <script type="text/javascript"> |
| 64 | + jQuery(document).ready(function () { |
| 65 | + "use strict"; |
| 66 | + var options = {}; |
| 67 | + options.rules = { |
| 68 | + activated: { |
| 69 | + wordTwoCharacterClasses: true |
| 70 | + }, |
| 71 | + specialCharClass: "[!,@,#,$,%,^,&,*,?,_,~,+]" |
| 72 | + }; |
| 73 | + options.ui = { |
| 74 | + container: "#pwd-container", |
| 75 | + viewports: { |
| 76 | + progress: ".pwstrength_viewport_progress" |
| 77 | + }, |
| 78 | + showVerdictsInsideProgressBar: true, |
| 79 | + showErrors: true |
| 80 | + }; |
| 81 | + options.common = { |
| 82 | + debug: true, |
| 83 | + onLoad: function () { |
| 84 | + $('#messages').text('Start typing password'); |
| 85 | + } |
| 86 | + }; |
| 87 | + $(':password').pwstrength(options); |
| 88 | + }); |
| 89 | + </script> |
| 90 | +</body> |
| 91 | + |
| 92 | +</html> |
0 commit comments