Advertisement
raffi_pratama

Untitled

Oct 20th, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 4.61 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>Form Log In</title>
  8.     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  9.     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
  10.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  11.     <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  12. </head>
  13. <style>
  14. .login {
  15.   min-height: 100vh;
  16. }
  17.  
  18. .bg-image {
  19.   background-image: url('Group 10.png');
  20.   background-size: cover;
  21.   background-position: center;
  22. }
  23.  
  24. .login-heading {
  25.   font-weight: 300;
  26. }
  27.  
  28. .btn-login {
  29.   font-size: 0.9rem;
  30.   letter-spacing: 0.05rem;
  31.   padding: 0.75rem 1rem;
  32. }
  33.  
  34. </style>
  35. <body>
  36.     <div class="container-fluid ps-md-0">
  37.         <div class="row g-0">
  38.           <div class="d-none d-md-flex col-md-4 col-lg-7 bg-image"></div>
  39.           <div class="col-md-8 col-lg-5">
  40.             <div class="login d-flex align-items-center py-5">
  41.               <div class="container">
  42.                 <div class="row">
  43.                   <div class="col-md-9 col-lg-8 mx-auto">
  44.                     <h3 class="login-heading mb-4">Leave us a message!</h3>
  45.      
  46.                     <!-- contact -->
  47.                     <form name="formPendaftaran" action="" onsubmit="return validateForm()" id="myForm">
  48.                         <div class="form-floating mb-3">
  49.                             <input type="name" name="nama" class="form-control" id="floatingInput" placeholder="nama">
  50.                             <label for="floatingInput">Name</label>
  51.                           </div>
  52.                       <div class="form-floating mb-3">
  53.                         <input type="email" name="email" class="form-control" id="floatingInput" placeholder="[email protected]">
  54.                         <label for="floatingInput">Email address</label>
  55.                       </div>
  56.                       <div class="form-floating mb-3">
  57.                         <input type="phone" name="phone" class="form-control" id="floatingInput" placeholder="phone">
  58.                         <label for="floatingInput">Phone Number</label>
  59.                       </div>
  60.                       <div class="form-floating mb-3">
  61.                         <textarea class="form-control" name="komen" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
  62.                         <label for="floatingTextarea2">Comments</label>
  63.                       </div>
  64.                       <div class="d-grid">
  65.                         <button class="btn btn-lg btn-primary btn-login text-uppercase fw-bold mb-2" type="submit">Submit</button>
  66.                       </div>                      
  67.                     </form>
  68.                   </div>
  69.                 </div>
  70.               </div>
  71.             </div>
  72.           </div>
  73.         </div>
  74.       </div>
  75.       <script>
  76.         function validateForm() {
  77.             if (document.forms["formPendaftaran"]["nama"].value == "") {
  78.                 alert("Fill name!");
  79.                 document.forms["formPendaftaran"]["nama"].focus();
  80.                 return false;
  81.             }
  82.             if (document.forms["formPendaftaran"]["email"].value == "") {
  83.                 alert("Fill email!");
  84.                 document.forms["formPendaftaran"]["email"].focus();
  85.                 return false;
  86.             }
  87.             if (document.forms["formPendaftaran"]["phone"].value == "") {
  88.                 alert("Fill password!");
  89.                 document.forms["formPendaftaran"]["phone"].focus();
  90.                 return false;
  91.             }
  92.             if (document.forms["formPendaftaran"]["komen"].value == "") {
  93.                 alert("Fill password!");
  94.                 document.forms["formPendaftaran"]["komen"].focus();
  95.                 return false;
  96.             }
  97.  
  98.             swal({
  99.                 title: "Data Berhasil Tersimpan",
  100.                 text: "Terima kasih telah mengisi form!",
  101.                 icon: 'success',
  102.             }).then(okay => {
  103.                 if (okay) {
  104.                     window.location.href = "index.html";
  105.                 }
  106.             });
  107.  
  108.  
  109.             return false;
  110.         }
  111.  
  112.  
  113.     </script>
  114. </body>
  115. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement