Postest 9 (percabangan Java Script)
14.13
By
Unknown
Pemrograman WEB
0
komentar
<HTML>
<HEAD><TITLE>Postest9 tentang Percabangan JavaScript</TITLE></HEAD>
<BODY>
<SCRIPT language="JavaScript">
<!--
function bdt()
{
var nama = (document.fform.inama.value);
var nim = (document.fform.inim.value);
var fak = (document.fform.ifak.value);
var kota_asal = (document.fform.ikota_asal.value);
var alamat = (document.fform.ialamat.value);
var tahun = parseFloat (document.fform.itahun.value);
var bulan = parseFloat(document.fform.ibulan.value);
var jka = (document.fform.ijka.value);
var agama = (document.fform.iagama.value);
var ma = (document.fform.ima.value);
var gg = 0.0;
var th = 0.0;
var bln = 0.0;
th= 2014-tahun;
bln = 5 - bulan;
gg=tahun % 2;
if (bln<0)
{
bln = 12+bln;
th= th-1;
}
else
{
}
if (gg==0)
{
gg = "ganjil";
}
else
{
gg = "genap";
}
/*if (document.fform.ima.checked==true)
{
document.writeln("Ya");
}
else
{
document.writeln("Tidak");
}*/
document.fform.onama.value=(nama);
document.fform.onim.value=(nim);
document.fform.ofak.value=(fak);
document.fform.okota_asal.value=(kota_asal);
document.fform.oalamat.value=(alamat);
document.fform.otahun.value=(th);
document.fform.obulan.value=(bln);
document.fform.oagama.value=(agama);
document.fform.ogg.value=(gg);
}
//--></SCRIPT>
<FORM NAME ="fform">
<table bgcolor="Lime" border="1" align="center"width="70%">
<tr>
<td width="100%" colspan="2"><H2 ALIGN="center">Biodata Mahasiswa</H2>
</td>
</tr>
<tr>
<td width="50%"><PRE>
Nama :<input type="text" size="20" name="inama">
NIM :<input type="text" size="20" name="inim">
Fakultas :<input type="text" size="20" name="ifak">
Kota_Asal :<input type="text" size="20" name="ikota_asal">
Alamat :
<textarea name="ialamat" cols="30" rows="4"></textarea>
TTL :<select name="itanggal" size="1">
<option value="00">Tanggal
<option value="01">01
<option value="02">02
<option value="03">03
<option value="04">04
<option value="05">05
<option value="06">06
<option value="07">07
<option value="08">08
<option value="09">09
<option value="10">10
<option value="11">11
<option value="12">12
<option value="13">13
<option value="14">14
<option value="15">15
<option value="16">16
<option value="17">17
<option value="18">18
<option value="19">19
<option value="20">20
<option value="21">21
<option value="22">22
<option value="23">23
<option value="24">24
<option value="25">25
<option value="26">26
<option value="27">27
<option value="28">28
<option value="29">29
<option value="30">30
<option value="31">31
</select><select name="ibulan" size="1">
<option value="00">Bulan
<option value="01">Januari
<option value="02">Febuari
<option value="03">Maret
<option value="04">April
<option value="05">Mei
<option value="06">Juni
<option value="07">Juli
<option value="08">Agustus
<option value="09">September
<option value="10">Oktober
<option value="11">November
<option value="12">Desember
</select><input type="text" name="itahun" size="5" value="Tahun">
Jenis Kelamin: <input type="radio" name="ijka" value="laki">laki-laki <input type="radio" name="ijka" value="cewek">Perempuan
Agama:<select name="iagama" size="1">
<option value="00">Agama
<option value="Islam">Islam
<option value="Kristen">Kristen
<option value="Hindu">Hindu
<option value="Budha">Budha
</select>
Mahasiswa Aktif: <input type="checkbox" name="ima" value="Ya">Ya
</td></pre>
<td width="50%"><pre>
Nama :<input type="text" size="20" name="onama">
Nim :<input type="text" size="20" name="onim">
Fakultas :<input type="text" size="20" name="ofak">
Kota_Asal :<input type="text" size="20" name="okota_asal">
Alamat :
<textarea name="oalamat" cols="30" rows="4"></textarea>
Umur : <input type="text" size="5" name="otahun"> Tahun <input type="text" size="5" name="obulan">Bulan
Umur genap/Ganjil:<input type="text" size="20" name="ogg">
Agama : <input type="text" size="20" name="oagama">
</td><pre>
</tr>
<tr>
<td width="100%" colspan="2">
<center>
<INPUT TYPE="button" value="save" onclick="bdt()">
<INPUT TYPE="reset" value="reset">
</center>
</td>
</tr>
</table>
</FORM>
</BODY>
</HTML>
berikut adalah Screen Shoot nya :
Read more
<HEAD><TITLE>Postest9 tentang Percabangan JavaScript</TITLE></HEAD>
<BODY>
<SCRIPT language="JavaScript">
<!--
function bdt()
{
var nama = (document.fform.inama.value);
var nim = (document.fform.inim.value);
var fak = (document.fform.ifak.value);
var kota_asal = (document.fform.ikota_asal.value);
var alamat = (document.fform.ialamat.value);
var tahun = parseFloat (document.fform.itahun.value);
var bulan = parseFloat(document.fform.ibulan.value);
var jka = (document.fform.ijka.value);
var agama = (document.fform.iagama.value);
var ma = (document.fform.ima.value);
var gg = 0.0;
var th = 0.0;
var bln = 0.0;
th= 2014-tahun;
bln = 5 - bulan;
gg=tahun % 2;
if (bln<0)
{
bln = 12+bln;
th= th-1;
}
else
{
}
if (gg==0)
{
gg = "ganjil";
}
else
{
gg = "genap";
}
/*if (document.fform.ima.checked==true)
{
document.writeln("Ya");
}
else
{
document.writeln("Tidak");
}*/
document.fform.onama.value=(nama);
document.fform.onim.value=(nim);
document.fform.ofak.value=(fak);
document.fform.okota_asal.value=(kota_asal);
document.fform.oalamat.value=(alamat);
document.fform.otahun.value=(th);
document.fform.obulan.value=(bln);
document.fform.oagama.value=(agama);
document.fform.ogg.value=(gg);
}
//--></SCRIPT>
<FORM NAME ="fform">
<table bgcolor="Lime" border="1" align="center"width="70%">
<tr>
<td width="100%" colspan="2"><H2 ALIGN="center">Biodata Mahasiswa</H2>
</td>
</tr>
<tr>
<td width="50%"><PRE>
Nama :<input type="text" size="20" name="inama">
NIM :<input type="text" size="20" name="inim">
Fakultas :<input type="text" size="20" name="ifak">
Kota_Asal :<input type="text" size="20" name="ikota_asal">
Alamat :
<textarea name="ialamat" cols="30" rows="4"></textarea>
TTL :<select name="itanggal" size="1">
<option value="00">Tanggal
<option value="01">01
<option value="02">02
<option value="03">03
<option value="04">04
<option value="05">05
<option value="06">06
<option value="07">07
<option value="08">08
<option value="09">09
<option value="10">10
<option value="11">11
<option value="12">12
<option value="13">13
<option value="14">14
<option value="15">15
<option value="16">16
<option value="17">17
<option value="18">18
<option value="19">19
<option value="20">20
<option value="21">21
<option value="22">22
<option value="23">23
<option value="24">24
<option value="25">25
<option value="26">26
<option value="27">27
<option value="28">28
<option value="29">29
<option value="30">30
<option value="31">31
</select><select name="ibulan" size="1">
<option value="00">Bulan
<option value="01">Januari
<option value="02">Febuari
<option value="03">Maret
<option value="04">April
<option value="05">Mei
<option value="06">Juni
<option value="07">Juli
<option value="08">Agustus
<option value="09">September
<option value="10">Oktober
<option value="11">November
<option value="12">Desember
</select><input type="text" name="itahun" size="5" value="Tahun">
Jenis Kelamin: <input type="radio" name="ijka" value="laki">laki-laki <input type="radio" name="ijka" value="cewek">Perempuan
Agama:<select name="iagama" size="1">
<option value="00">Agama
<option value="Islam">Islam
<option value="Kristen">Kristen
<option value="Hindu">Hindu
<option value="Budha">Budha
</select>
Mahasiswa Aktif: <input type="checkbox" name="ima" value="Ya">Ya
</td></pre>
<td width="50%"><pre>
Nama :<input type="text" size="20" name="onama">
Nim :<input type="text" size="20" name="onim">
Fakultas :<input type="text" size="20" name="ofak">
Kota_Asal :<input type="text" size="20" name="okota_asal">
Alamat :
<textarea name="oalamat" cols="30" rows="4"></textarea>
Umur : <input type="text" size="5" name="otahun"> Tahun <input type="text" size="5" name="obulan">Bulan
Umur genap/Ganjil:<input type="text" size="20" name="ogg">
Agama : <input type="text" size="20" name="oagama">
</td><pre>
</tr>
<tr>
<td width="100%" colspan="2">
<center>
<INPUT TYPE="button" value="save" onclick="bdt()">
<INPUT TYPE="reset" value="reset">
</center>
</td>
</tr>
</table>
</FORM>
</BODY>
</HTML>
berikut adalah Screen Shoot nya :
Read more