Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Form Persetujuan Kuliah Offline</title>
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
- <script type="text/javascript" src="main.js"></script>
- <script>
- function validateForm() {
- var email = document.forms["ptm"]["email"];
- atposition = email.value.atposition("@");
- dotpositon = email.value.lastIndexOf(".");
- function notify() {
- alert("Terima Kasih telah mengisi formulir persetujuan kuliah offline.");
- }
- if (document.forms["ptm"]["nama"].value == "") {
- alert("Mohon Isi Nama Anda.");
- document.forms["ptm"]["nama"].focus();
- return false;
- }
- if (document.forms["ptm"]["nrp"].value == "") {
- alert("Mohon Isi NRP Anda.");
- document.forms["ptm"]["nrp"].focus();
- return false;
- }
- if (document.forms["ptm"]["alamat"].value == "") {
- alert("Mohon Isi Alamat Anda.");
- document.forms["ptm"]["alamat"].focus();
- return false;
- }
- if (email.value == "" && atposition < 1 || (dotpositon - atposition < 2)) {
- alert("Mohon Masukkan Email Anda dengan benar");
- email.focus();
- return false;
- }
- if (document.forms["ptm"]["jurusan"].selectedIndex < 1) {
- alert("Pilih Jurusan Anda");
- document.forms["ptm"]["jurusan"].focus();
- return false;
- }
- if (document.forms["ptm"]["vaksin"].selectedIndex < 1) {
- alert("Pilih Status Vaksin Anda");
- document.forms["ptm"]["vaksin"].focus();
- return false;
- }
- notify();
- return true;
- }
- </script>
- </head>
- <body>
- <div class="form-container">
- <div class="formulir">
- <h1>Formulir Persetujuan Kuliah Offline</h1>
- <form autocomplete="off" name="ptm" onsubmit="return validateForm();">
- <div class="form-content">
- <label>Nama Lengkap</label>
- <input type="text" name="nama" placeholder="Nama" class="form-control" maxlength="50">
- </div>
- <div class="form-content">
- <label>NRP</label>
- <input type="text" name="nrp" placeholder="NRP" class="form-control" maxlength="14">
- </div>
- <div class="form-content">
- <label>Alamat</label>
- <input type="text" name="alamat" placeholder="Alamat" class="form-control">
- </div>
- <div class="form-content">
- <label>Email</label>
- <input type="text" name="email" placeholder="Email" class="form-control">
- </div>
- <div class="form-content">
- <label>Jurusan</label>
- <select name="jurusan" class="form-control">
- <option value="0">Pilih Jurusan</option>
- <option value="1">Teknik Informatika</option>
- <option value="2">Sistem Informasi</option>
- <option value="3">Teknologi Informasi</option>
- <option value="4">Teknik Komputer</option>
- <option value="5">Teknik Elektro</option>
- </select>
- </div>
- <div class="form-content">
- <label>Status Vaksin</label>
- <select name="vaksin" class="form-control">
- <option value="0">Status Vaksin</option>
- <option value="1">Belum Vaksin</option>
- <option value="2">Vaksin Pertama</option>
- <option value="3">Vaksin Kedua</option>
- </select>
- </div>
- <button type="submit" class="btn btn-primary">submit</button>
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment