Advertisement
daniramadhan7

JavaScript Registrasi Kuliah Tatap Muka

Oct 11th, 2021
1,144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function validateForm() {
  2.     if (document.forms["formPendaftaran"]["nama"].value == "") {
  3.         alert("Nama tidak boleh kosong");
  4.         document.forms["formPendaftaran"]["nama"].focus();
  5.         return false;
  6.     }
  7.     if (document.forms["formPendaftaran"]["nrp"].value == "") {
  8.         alert("NRP tidak boleh kosong");
  9.         document.forms["formPendaftaran"]["nrp"].focus();
  10.         return false;
  11.     }
  12.     if (document.forms["formPendaftaran"]["email"].value == "") {
  13.         alert("Email tidak boleh kosong");
  14.         document.forms["formPendaftaran"]["email"].focus();
  15.         return false;
  16.     }
  17.     if (document.getElementById("departemen").value == "0") {
  18.         alert("Pilih Departemen");
  19.         document.forms["formPendaftaran"]["departemen"].focus();
  20.         return false;
  21.     }
  22.     if (!this.formPendaftaran.vaksin1.checked) {
  23.         if (!this.formPendaftaran.vaksin2.checked) {
  24.             alert("Harap mengisi status vaksinasi");
  25.             document.forms["formPendaftaran"]["vaksin1"].focus();
  26.             document.forms["formPendaftaran"]["vaksin2"].focus();
  27.             return false;
  28.         }
  29.     }
  30. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement