rezamalik15

user_edit_form.blade.php

Jul 16th, 2023
1,144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.08 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Register</title>
  8.     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
  9. </head>
  10. <body>
  11.  
  12.     <div class="container">
  13.  
  14.         <div class="position-absolute top-50 start-50 translate-middle w-50 shadow p-3">
  15.  
  16.             <form action="/user/edit/{{ $user->id }}" method="post">
  17.                 @csrf
  18.  
  19.                 <h2 class="text-center">Edit data user</h2>
  20.    
  21.                 <div class="mb-3">
  22.                     <label for="name">Nama</label>
  23.                     <input class="form-control col" type="text" id="name" value="{{$user->name}}" name="name">
  24.                 </div>
  25.  
  26.                 <div class="mb-3">
  27.                     <label for="email">Email</label>
  28.                     <input class="form-control col" type="email" id="email" value="{{$user->email}}" name="email">
  29.                 </div>
  30.  
  31.                 <div class="mb-3">
  32.                     <fieldset class="border border-warning p-3">
  33.  
  34.                         <legend>Isi jika ingin ubah password</legend>
  35.  
  36.                         <div class="mb-3">
  37.                             <label for="password">Password Baru</label>
  38.                             <input class="form-control col" type="password" id="password" placeholder="Masukkan password" onkeyup=validatePassword() name="password">
  39.                         </div>
  40.    
  41.                         <div class="mb-3">
  42.                             <label for="password2">Konfirmasi Password Baru</label>
  43.                             <input class="form-control col" type="password" id="password2" placeholder="Masukkan ulang password" onkeyup=validatePassword() name="password2">
  44.                         </div>
  45.  
  46.                     </fieldset>
  47.                 </div>
  48.  
  49.                 <div class="mb-3">
  50.                     <a href="{{ url()->previous() }}" class="btn btn-secondary">Batal</a>
  51.                     <input class="btn btn-primary" type="submit" id="submitForm" value="Simpan">
  52.                 </div>
  53.    
  54.             </form>
  55.  
  56.         </div>
  57.  
  58.     </div>
  59.  
  60.     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>  
  61.     <script>
  62.         const password1 = document.getElementById('password')
  63.         const password2 = document.getElementById('password2')
  64.         const submitButton = document.getElementById('submitForm')
  65.  
  66.         console.log(submitButton)
  67.  
  68.         function validatePassword(){
  69.             if(password1.value !== password2.value){
  70.                 submitButton.disabled = true
  71.             } else {
  72.                 submitButton.disabled = false
  73.             }
  74.         }
  75.        
  76.     </script>
  77. </body>
  78. </html>
Advertisement
Add Comment
Please, Sign In to add comment