Advertisement
pkbagchi

Untitled

Nov 9th, 2021
757
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 8.01 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="https://www.thymeleaf.org">
  3. <head>
  4.     <title>PG Admission Portal</title>
  5.     <link rel = "icon" th:href ="@{/images/logo-aust.png}" type = "image/x-icon">
  6.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  7.     <!-- Required meta tags -->
  8.     <meta charset="utf-8">
  9.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  10.     <link rel="stylesheet"
  11.           th:href="@{https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css}">
  12.     <link rel="stylesheet" th:href="@{https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css}">
  13.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css" />
  14.     <script th:src="@{https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js}"></script>
  15.     <link rel="stylesheet" th:href="@{/css/layout.css}">
  16.     <style>
  17.  
  18.         ul, li {
  19.             margin: 0;
  20.             padding: 0;
  21.             list-style-type: none;
  22.         }
  23.  
  24.         .invalid {
  25.             padding-left: 22px;
  26.             line-height: 24px;
  27.             color: #ec3f41;
  28.         }
  29.  
  30.         .valid {
  31.             padding-left: 22px;
  32.             line-height: 24px;
  33.             color: #3a7d34;
  34.         }
  35.         #togglePassword {
  36.             float: right;
  37.             margin-bottom: -30px;
  38.         }
  39.  
  40.  
  41.     </style>
  42. </head>
  43. <body>
  44. <div class="container login-wrapper">
  45.     <div class="row">
  46.         <div class="col-md-8 col-sm-7 hidden-xs login-left"></div>
  47.         <div class="col-sm-12 login-right">
  48.             <div class="row"  align="center" style="display: block; text-align: center; padding-bottom: 10px">
  49.                 <h2 class="login-head-title">AUST Postgraduate Admission System</h2>
  50.             </div>
  51.  
  52.             <div class="row" align="center" style="display: block; text-align: center; padding-bottom: 5px"><img th:src="@{/images/logo-aust.png}"
  53.                                                                                                                  title="AMAS" alt="AMAS" height="92"></div>
  54.             <!--    <div class="row" style="display: block; text-align: center;">
  55.                         <span class="IUMS-slogan">Ahsanullah University of Science and Technology (AUST)</span>
  56.                 </div>-->
  57.  
  58.             <div class="IUMS-sub-head">Please Provide your Password.</div>
  59.  
  60.  
  61.             <div th:if="${errorMsgToken}" class="alert alert-danger">
  62.                 <span th:text="${errorMsgToken}"></span>
  63.             </div>
  64.  
  65.             <div th:if="${ResetPassMsg}" class="alert alert-success">
  66.                 <span th:text="${ResetPassMsg}"></span>
  67.             </div>
  68.  
  69.             <form th:action="@{/reset-password}" th:object="${passwordResetForm}" method="post" th:if="!${errorMsgToken} and !${ResetPassMsg}"
  70.             >
  71.                 <div class="form-group">
  72.                     <input type="hidden" name="token" th:value="${token}"/>
  73.                     <label for="password" class="contact-label">Password</label>
  74.                     <input id="password"
  75.                            class="form-control"
  76.                            placeholder="password"
  77.                            type="password"
  78.                            th:field="*{password}"/>
  79.                     <i class="bi bi-eye-slash" id="togglePassword"></i>
  80.                     <br>
  81.                     <label for="confirmPassword" class="contact-label">Confirm Password</label>
  82.                     <input id="confirmPassword"
  83.                            class="form-control"
  84.                            placeholder="Confirm password"
  85.                            type="password"
  86.                            th:field="*{confirmPassword}"/>
  87.                     <span class='error' style='display:none; color: red' id='mismatchError'>
  88.                                     Password does not match
  89.                                 </span>
  90.                 </div>
  91.  
  92.                 <div id="pswd_info" class="form-group">
  93.  
  94.                     <div class="col-md-12">
  95.                         <p>Password must meet the following requirements:</p>
  96.                         <ul>
  97.                             <li id="letter" class="invalid">At least <strong>one letter</strong>
  98.                             </li>
  99.                             <li id="capital" class="invalid">At least <strong>one capital
  100.                                 letter</strong></li>
  101.                             <li id="number" class="invalid">At least <strong>one number</strong>
  102.                             </li>
  103.                             <li id="length" class="invalid">Be at least <strong>8
  104.                                 characters</strong>
  105.                             </li>
  106.                         </ul>
  107.                     </div>
  108.                 </div>
  109.  
  110.                 <div class="text-center mt-0">
  111.                     <input class="btn" type="submit" id="btn_change_password" value="Reset Password"/>
  112.                 </div>
  113.             </form>
  114.             <div class="text-center mt-0" th:if="${errorMsgToken}">
  115.                 <a class="btn" th:href="@{/forgot-password}">Back to Forgot Password</a>
  116.             </div>
  117.             <div class="text-center mt-0" th:if="${ResetPassMsg}">
  118.                 <a class="btn" th:href="@{/pgas/login}">Back to Login</a>
  119.             </div>
  120.  
  121.             <p class="copy-right"><br/>
  122.                 <span class="newYear">2021</span> &copy; - Ahsanullah University of Science and Technology</p>
  123.         </div>
  124.     </div>
  125. </div>
  126. </body>
  127.  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  128. <script>
  129.     $(document).ready(function () {
  130.         let totalValid = 0;
  131.         $("#password").keyup(function () {
  132.             let pswd = $(this).val();
  133.             totalValid = 0;
  134.  
  135.             //validate the length
  136.             if (pswd.length < 8) {
  137.                 $('#length').removeClass('valid').addClass('invalid');
  138.             } else {
  139.                 $('#length').removeClass('invalid').addClass('valid');
  140.                 totalValid++;
  141.             }
  142.  
  143.             //validate letter
  144.             if (pswd.match(/[a-z]/)) {
  145.                 $('#letter').removeClass('invalid').addClass('valid');
  146.                 totalValid++;
  147.             } else {
  148.                 $('#letter').removeClass('valid').addClass('invalid');
  149.  
  150.             }
  151.  
  152.             //validate uppercase letter
  153.             if (pswd.match(/[A-Z]/)) {
  154.                 $('#capital').removeClass('invalid').addClass('valid');
  155.                 totalValid++;
  156.             } else {
  157.                 $('#capital').removeClass('valid').addClass('invalid');
  158.             }
  159.  
  160.             //validate number
  161.             if (pswd.match(/\d/)) {
  162.                 $('#number').removeClass('invalid').addClass('valid');
  163.                 totalValid++;
  164.             } else {
  165.                 $('#number').removeClass('valid').addClass('invalid');
  166.             }
  167.         });
  168.         let matchValid = 0;
  169.         $("#confirmPassword").keyup(function () {
  170.             matchValid = 0;
  171.             let confirmPswd = $(this).val();
  172.             let password = $("#password").val();
  173.             if (confirmPswd === password) {
  174.                $('#mismatchError').hide();
  175.                 matchValid = 1;
  176.             } else {
  177.                 $('#mismatchError').show();
  178.                 matchValid = 0;
  179.             }
  180.             if (totalValid == 4 && matchValid == 1)
  181.                 enableDisableButton("enable");
  182.             else
  183.                 enableDisableButton("disable");
  184.         });
  185.  
  186.         function enableDisableButton(op) {
  187.             if (op == "enable") {
  188.                 $("#btn_change_password").removeClass("disabled");
  189.                 $("#btn_change_password").attr("disabled", false);
  190.             } else {
  191.                 $("#btn_change_password").addClass("disabled");
  192.                 $("#btn_change_password").attr("disabled", true);
  193.             }
  194.         }
  195.  
  196.         enableDisableButton("disable");
  197.  
  198.     });
  199.  
  200. </script>
  201. </html>
  202.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement