http://com-vic.blogspot.com/
Praktikum-1
Praktikum-2
Praktikum-1
<html>
<head>
<title> Tombol Tes VBSCRIPT
</title>
</head>
<body>
<h1>If then Else Dalam ASP for
VBSCRIPT </h1>
<input name="cmdnow" size=5
type=button value="Print Date">
<SCRIPT
LANGUAGE="VBSCRIPT">
<!--
sub cmdnow_OnClick()
document.write "<br>"
document.write "Current Date :"
& formatdatetime(now(),vblongdate)
document.write "<br>"
end sub
-->
</SCRIPT>
</body>
</html>
Praktikum-2
<html>
<head>
<title>New Page 1</title>
</head>
<body bgcolor="#CC66FF">
<hr align="left">
<table width="192">
<tr>
<td bgcolor="#CC66FF" width="65"
align="left"><font color="#FFFFFF"><b>Input
A</b></font>
<td bgcolor="#CC66FF" width="115"
align="center"><input type="text" size="14"
maxlength="256" name="nilaia" style="background-color:
#00FF00">
</tr>
<tr>
<td bgcolor="#CC66FF" width="65"
align="left"><font color="#FFFFFF"><b>Input
B</b></font>
<td bgcolor="#CC66FF" width="115"
align="center"><input type="text" size="14"
maxlength="256" name="nilaib" style="background-color:
#00FF00">
</tr>
<tr>
<td bgcolor="#CC66FF" width="65"
align="left"><font
color="#FFFFFF"><b>Hasil </b></font>
<td bgcolor="#CC66FF" width="115"
align="center"><input type="text" size="14"
maxlength="256" name="hasilab"
style="background-color: #00FF00">
</tr>
</table>
<p><input type="submit" name ="cmdtambah"
size=4 value=" + ">
<input type="reset" size=4 name ="cmdkali"
value=" * ">
<input type="reset" size=4 name ="cmdbagi"
value=" / ">
<input type="reset" size=4 name ="cmdkurang"
value=" - ">
<input type="reset" size=4 name ="cmdpangkat"
value=" ^ ">
<input type="reset" size=4 name ="cmdbagi1"
value=" \ ">
<input type="reset" size=4 name ="cmdsisabagi"
value="Mod">
<input type="reset" size=4 name ="cmdclear"
value=" C "></p>
<hr>
<Script
Language="vbscript">
<!--
sub cmdtambah_OnClick()
if nilaia.value = "" or
nilaib.value = "" then
msgbox "Harus diisi...!!",64,"Pesan Input"
exit sub
end if
hasilab.value = cdbl(nilaia.value) +
cdbl(nilaib.value)
end sub
sub cmdkali_OnClick()
hasilab.value = cdbl(nilaia.value) *
cdbl(nilaib.value)
end sub
sub cmdbagi_OnClick()
hasilab.value = cdbl(nilaia.value) /
cdbl(nilaib.value)
end sub
sub cmdbagi1_OnClick()
hasilab.value = cint(nilaia.value) \
cint(nilaib.value)
end sub
sub cmdpangkat_OnClick()
hasilab.value = cdbl(nilaia.value) ^
cdbl(nilaib.value)
end sub
sub cmdkurang_OnClick()
hasilab.value = cdbl(nilaia.value) -
cdbl(nilaib.value)
end sub
sub cmdsisabagi_OnClick()
hasilab.value = cdbl(nilaia.value) mod
cdbl(nilaib.value)
end sub
sub cmdclear_OnClick()
hasilab.value = " "
nilaia.value
= " "
nilaib.value
= " "
end sub
-->
</script>
</body>
</html>
0 komentar:
Posting Komentar