TUGAS PWEB-D Pertemuan - 5 : Form Validasi
TUGAS PWEB-D Pertemuan - 5 : Form Validasi
Perkenalkan nama saya Andymas Narendra Bagaskara, NRP 05111940000192, Kelas Pemrograman Web D. Pada pertemuan keempat kelas PWEB-D, saya diberi tugas untuk membuat website Form Validasi Vaksinasi dengan menggunakan JavaScript.
Berikut ini hasil dari warung saya :
Link Websitenya : https://tugas5pwebd.netlify.app/
Dan untuk hosting domainnya saya menggunakan Netlify dengan cara memasukan file html Biodata
ke dalam website netlify tersebut.
Source Code HTML :
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap" rel="stylesheet" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="style.css" />
<title>Form Validasi Vaksinasi</title> </head> <body> <div class="container"> <div class="header"> <img src="logo.png" alt="logo-its" width="100" height= "100" > <h1> Form Validasi Vaksinasi Mahasiswa ITS </h1> </div> <form class="form" id="form"> <div class="form-control"> <label> Nama Lengkap</label> <input type="text" placeholder="Nama Lengkap" id="nama" /> <i class="fa fa-check-circle"></i> <i class="fa fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="form-control"> <label> NRP</label> <input type="text" placeholder="0511194000xxx" id="nrp" /> <i class="fa fa-check-circle"></i> <i class="fa fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="form-control"> <label> Email</label> <input type="email" placeholder="Email Kamu" id="email" /> <i class="fa fa-check-circle"></i> <i class="fa fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="form-control"> <label> Alamat Lengkap</label> <input type="text" placeholder="Alamat Domisili" id="alamat" /> <i class="fa fa-check-circle"></i> <i class="fa fa-exclamation-circle"></i> <small>Error message</small> </div> <div class="form-control"> <label> Departemen</label> <select name="departemen" id="departemen"> <option selected>- Pilih Jurusan -</option> <option value="16">Teknik Elektro</option> <option value="17">Teknik Biomedik</option> <option value="18">Teknik Komputer</option> <option value="19">Teknik Informatika</option> <option value="20">Sistem Informasi</option> <option value="21">Teknologi Informasi</option> </select> <i class="fa fa-check-circle icon-select-sign"></i> <i class="fa fa-exclamation-circle icon-select-sign"></i> <small>Error message</small> </div> <div class="form-control"> <label>Status Vaksin</label> <br /> <select onchange="isVaksin()" id="ketvaksin" name="ket-vaksin"> <option value="0">Pilih Status Vaksin</option> <option value="1">Sudah</option> <option value="2">Belum</option> </select> <i class="fa fa-check-circle icon-select-sign"></i> <i class="fa fa-exclamation-circle icon-select-sign"></i> <small>Error message</small> </div> <div id="sudah-vaksin" class="verify-vaksin sudah-vaksin"> <div class="form-control"> </div> <div class="form-control"> </div> <div class="form-control"> </div> </div> <div id="belum-vaksin" class="verify-vaksin belum-vaksin"> <div class="form-control"> </div> </div> <button>Submit</button> </form> </div> <script type="text/javascript"> alertify.defaults.transition = "zoom"; alertify.defaults.theme.ok = "ui positive button"; alertify.defaults.theme.cancel = "ui black button"; </script> <script src="app.js"></script> </body> </html>
Source Code CSS :
}@import url("https://fonts.googleapis.com/css?family=Open+Sans:400,500,&display=swap");
* {
box-sizing: border-box;
}
body {
background-color: #f3f3f3;
font-family: "Open Sans", sans-serif;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 24px 0;
margin: 0;
}
.container {
background-color: white;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
width: 460px;
overflow: hidden;
max-width: 100%;
}
.header {
background-color: #1ba3e2;
border-bottom: 1px solid #6c86ad;
padding: 20px 40px;
}
.header h2 {
margin: 0;
font-weight: 800;
color: #343a40;
text-align: center;
}
img{
display:block;
text-align: center;
margin-left: auto;
margin-right: auto;
}
.form {
padding: 30px 40px;
}
.form-control {
margin-bottom: 10px;
padding-bottom: 20px;
position: relative;
}
.form-control label {
display: inline-block;
margin-bottom: 5px;
}
.form-control input,
select,
textarea {
border: 2px solid #f0f0f0;
border-radius: 4px;
display: block;
font-family: inherit;
font-size: 14px;
padding: 10px;
width: 100%;
}
select {
text-overflow: ellipsis;
}
.form-control.success input,
.form-control.success select,
.form-control.success textarea {
border-color: #2ecc71;
}
.form-control.error input,
.form-control.error select,
.form-control.error textarea {
border-color: #e74c3c;
}
.form-control i {
position: absolute;
top: 40px;
right: 10px;
visibility: hidden;
}
.form-control.success i.fa-check-circle {
visibility: visible;
color: #2ecc71;
}
.form-control.error i.fa-exclamation-circle {
visibility: visible;
color: #e74c3c;
}
.form-control small {
visibility: hidden;
position: absolute;
bottom: 0;
left: 0;
}
.form-control.error small {
visibility: visible;
color: #9e473d;
}
.form button {
background-color: #4890f5;
border: 2px solid #374d66;
display: block;
width: 100%;
padding: 10px;
color: rgb(5, 5, 5);
font-size: 18px;
border-radius: 8px;
font-family: inherit;
}
.form button:hover{
background-color: yellow;
color: white;
}
.header-verify-vaksin {
text-align: center;
padding-top: 1.2rem;
border-top: 0.8px solid #eee;
}
.verify-vaksin {
display: none;
}
.form-control i.icon-select-sign {
right: 24px;
}
Sekian penjelasan tugas dari saya mohon maaf jika ada kesalahan, sekian terima kasih.
Komentar
Posting Komentar