-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
25 lines (23 loc) · 874 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var x = 1;
function formInput()
{
var nama = document.forms['bio']['NamaPariwisata'].value;
var deskripsi = document.forms['bio']['Deskripsi'].value;
var tgl = document.forms['bio']['TanggalDibangun'].value;
var gambar = document.forms['bio']['gambar'].value;
var d = [nama,deskripsi,tgl,gambar];
if(nama==null || nama=="" || deskripsi==null || deskripsi=="" || tgl==null || tgl=="" || gambar==null || gambar=="") {
alert("data tidak boleh kosong!!!");
}
if(nama!=null && nama!="" && deskripsi!=null && deskripsi!="" && tgl!=null && tgl!="" && gambar!=null && gambar!="") {
var row = document.getElementById("output").insertRow(x);
var i;
for (i=0; i < d.length; i++)
{
var cell = row.insertCell(i);
cell.innerHTML = d[i];
}
x++;
alert("data berhasil di entry");
}
}