<html>
<title>H_KEY</title>
<body>
<script language="javascript">
function ceknama(form)
{
<title>H_KEY</title>
<body>
<script language="javascript">
function ceknama(form)
{
if(form.elements[0].value=="")
{
window.alert("nama harus diisi !");
form.in_nama.focus();
}
window.alert("nama harus diisi !");
form.in_nama.focus();
}
}
function ceknamaalamat(form)
{
function ceknamaalamat(form)
{
if(form.elements[0].value=="")
{
window.alert("nama harus diisi !");
form.in_nama.focus();
}
if(form.elements[1].value=="")
{
window.alert("alamat harus diisi !");
form.in_alamat.focus();
}
}
</script>
<form>
Nama = <input type="text" name="in_nama"> <br>
Alamat = <input type="text" name="in_alamat" onclick="ceknama(this.form)"> <br>
<input type="button" value="Ok" onclick="ceknamaalamat(this.form)">
</form>
</body>
window.alert("nama harus diisi !");
form.in_nama.focus();
}
if(form.elements[1].value=="")
{
window.alert("alamat harus diisi !");
form.in_alamat.focus();
}
}
</script>
<form>
Nama = <input type="text" name="in_nama"> <br>
Alamat = <input type="text" name="in_alamat" onclick="ceknama(this.form)"> <br>
<input type="button" value="Ok" onclick="ceknamaalamat(this.form)">
</form>
</body>
</html>
Sekian contoh dari saya semoga bermanfaan hehe , Bila mau belajar dengan saya atau bertanya tanya soal HTML,PHP. insyaallah saya bisa membantu . hubungi Contac saya hehe
=========TERIMAKASIH TELAH BERKUNJUNG========
Posted by 4/24/2014 10:15:00 pm and have
0
comments
, Published at
No comments:
Post a Comment