Aniket_Goku

Password

Sep 4th, 2021 (edited)
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  2. <meta charset="utf-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1">
  4. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  5. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  6. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  7. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  8. <style>
  9. h4{
  10. color:red;
  11. }
  12. </style>
  13. <script>
  14. $(document).ready(function(){
  15.  
  16. $('#txtp').click(function(){
  17. var a=$('#txticon').attr('class');
  18. if(a=="fa fa-eye")
  19. {
  20. $('#txticon').attr('class',"fa fa-eye-slash");
  21. $('#txt1').attr('type','TEXT');
  22.  
  23. }
  24. else
  25. {
  26. $('#txticon').attr('class',"fa fa-eye");
  27. $('#txt1').attr('type','password');
  28. }
  29.  
  30. });
  31. $('#txt1').keyup(function(){
  32. var p1="";
  33. var a=$('#txt1').val();
  34. if(/[A-Z]+/.test(a)==true)
  35. {
  36. $('#p3').css('color','green');
  37. $('#c3').attr('class','fa fa-check-circle');
  38. }
  39. else
  40. {
  41. $('#p3').css('color','red');
  42. $('#c3').attr('class','fa fa-times-circle');
  43. }
  44. if(/[a-z]+/.test(a)==true)
  45. {
  46. $('#p2').css('color','green');
  47. $('#c2').attr('class','fa fa-check-circle');
  48. }
  49. else
  50. {
  51. $('#p2').css('color','red');
  52. $('#c2').attr('class','fa fa-times-circle');
  53. }
  54. if(/[0-9]+/.test(a)==true)
  55. {
  56. $('#p4').css('color','green');
  57. $('#c4').attr('class','fa fa-check-circle');
  58. }
  59. else
  60. {
  61. $('#p4').css('color','red');
  62. $('#c4').attr('class','fa fa-times-circle');
  63. }
  64. if(a.length>=8)
  65. {
  66. $('#p1').css('color','green');
  67. $('#c1').attr('class','fa fa-check-circle');
  68. }
  69. else
  70. {
  71. $('#p1').css('color','red');
  72. $('#c1').attr('class','fa fa-times-circle');
  73. }
  74. if(/^[a-zA-Z0-9]*$/.test(a)==false)
  75. {
  76. $('#p5').css('color','green');
  77. $('#c5').attr('class','fa fa-check-circle');
  78. }
  79. else
  80. {
  81. $('#p5').css('color','red');
  82. $('#c5').attr('class','fa fa-times-circle');
  83. }
  84. });
  85.  
  86.  
  87. });
  88. </script>
  89. <html>
  90. <head>
  91. <title>
  92. JQ4
  93. </title>
  94.  
  95.  
  96.  
  97. <head>
  98. <body class="bg-info text-light">
  99. <h1 align="center">Password</h1>
  100. <form >
  101. <div class="row offset-md-4 col-md-4">
  102. <div CLASS="input-group">
  103. <input type="password" id="txt1"class="form-control" placeholder="Enter the password!">
  104. <div class="input-group-postpend">
  105. <div id="txtp"class="input-group-text">
  106.  
  107. <i class="fa fa-eye" id="txticon" style="height:25px"></i>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112.  
  113. <br>
  114. <center>
  115. <div class="bg-warning" style="text-align:center;width:60%">
  116. <div class="row offset-md-3 col-md-8 ">
  117. <h4 id="p1"><p ><i id="c1" class="fa fa-times-circle"></i> minimum 8 characters</p></h4>
  118. </div>
  119. <div class="row offset-md-3 col-md-8 ">
  120. <h4 id="p2"><p ><i id="c2" class="fa fa-times-circle"></i> minimum 1 Small alphabet</p></h4>
  121. </div>
  122. <div class="row offset-md-3 col-md-8 ">
  123. <h4 id="p3" ><p ><i id="c3" class="fa fa-times-circle"></i> minimum 1 capital alphabet</p></h4>
  124. </div>
  125. <div class="row offset-md-3 col-md-8 ">
  126. <h4 id="p4"><p ><i id="c4" class="fa fa-times-circle"></i> minimum 1 digit</p></h4>
  127. </div>
  128. <div class="row offset-md-3 col-md-8 ">
  129. <h4 id="p5"><p ><i id="c5" class="fa fa-times-circle"></i> minimum 1 special characters</p></h4>
  130. </div>
  131. </div>
  132. </form>
  133. </body>
  134. <html>
Add Comment
Please, Sign In to add comment