gurumutant

JQuery - Validasi Form Client-Side

Nov 23rd, 2020
10,343
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Form Validation Menggunakan JQuery</title>
  5.     <script src="lib/jquery.min.js"></script>
  6.     <script type="text/javascript">
  7.         // memastikan dokumen selesai dimuat
  8.         $(function(){
  9.             $('#btnSimpan').click(function(){
  10.                 var valid = true;
  11.                 if ($('#txtNama').val().trim() == '') { // mengecek kekosongan value
  12.                     $('#pesanNama').show().html('Anda harus mengisikan nama!<br>').css('color','red').fadeOut(2000);
  13.                     valid = false;
  14.                 }
  15.                 if ($('#txtKomentar').val().trim() == '') { // mengecek kekosongan value
  16.                     $('#pesanKomen').show().html('Anda harus mengisikan komentar!<br>').css('color','red').fadeOut(2000);
  17.                     valid = false;
  18.                 }                
  19.                
  20.                 if (valid) {
  21.                     var nama = $('#txtNama').val();
  22.                     var komen = $('#txtKomentar').val();
  23.                     $('#frmKomen').fadeOut('slow');
  24.                     $('#pesanSubmit').html(nama+", komentar Anda berhasil disimpan!<br>Komentar Anda:<br>"+komen);
  25.                 }
  26.             });
  27.         });
  28.     </script>
  29. </head>
  30. <body>
  31. <h1>Form Submission Validation</h1>
  32. <form id="frmKomen">
  33.     <label for="txtNama">Nama</label><br>
  34.     <input type="text" id="txtNama" name="txtNama"><br>
  35.     <span id="pesanNama"></span>
  36.     <label for="txtKomentar">Komentar</label><br>
  37.     <textarea id="txtKomentar" name="txtKomentar"></textarea><br>
  38.     <span id="pesanKomen"></span>
  39.     <input type="button" value="Simpan" id="btnSimpan">
  40. </form>
  41. <p id="pesanSubmit"></p>    
  42. </body>
  43. </html>
Advertisement
Comments
  • Mirhoron
    125 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment