Home » » Dasar Tag HTML Kedua

Dasar Tag HTML Kedua

Posted by Catatan Wong Awam on Monday, 10 February 2014



Form
       Awal formulir ditandai dengan Tag <FORM>, dan berisi dua kata kunci: METHOD dan ACTION.
                <form name=nama_form  method=post/get  action=nama_file/email>

Contoh Form 1
<html>
                <head>
                                <title>Latihan 33</title>
                </head>
<body>
<form name=mhs_baru method=post action=proses.php>
………………
</form>
</body>
</html>

Contoh Form 2
Input Text:
<input name=nama_input type=text size=lebar_input maxlength=kar._maks.>
<html>
                <head>
                                <title>Latihan 34</title>
                </head>
<body>
                <h2>Form Mahasiswa</h2>
                <form name=form_mahasiswa>
                NIM<br>
                <input name=nim type=text size=20
        maxlength=8><br>
                Nama Lengkap<br>
                <input name=nama type=text size=40>
                </form>
</body>
</html>

Contoh Form 3
Radio Button:
<input name=nama_input type=radio checked>
<html>
                <head>
                                <title>Latihan 35</title>
                </head>
<body>
                <form name=form_jeniskelamin>
                Jenis Kelamin:<br>
                <input name=gender type=radio checked>
Laki-laki<br>
                <input name=gender type=radio>
                Perempuan
                </form>
</body>
</html>

Contoh Form 4
Check Box:
<input name=nama_input type=checkbox checked>
<html>
                <head>
                                <title>Latihan 36</title>
                </head>
<body>
                <form name=form_fak>
                Fakultas Ilmu Komputer:<br>
                <input name=si type=checkbox checked>
Sistem Informasi<br>
                <input name=sk type=checkbox>
Sistem Komputer
                </form>
</body>
</html>

Contoh Form 5
Drop-down List:
<select name=nama_list>
                <option value=nama_opsi1>…</option>
                <option value=nama_opsi2>…</option>
                <option value=nama_opsi3>…</option>
</select>

Contoh Form 6
Drop-down List:
<html>
                <head>
                                <title>Latihan 37</title>
                </head>
<body>
                <form name=list>
                Level:<br>
                <select name=level>
                                <option value=stand>Standart</option>
                                 <option value=prof>Professional</option>
                </select>
                </form>
</body>
</html>
Contoh Form 7
Textarea:
<textarea name=nama_input rows=ukuran_tinggi cols=ukuran_lebar>
</textarea>

Contoh Form 8
Textarea:
<html>
                <head>
                                <title>Latihan 38</title>
                </head>
<body>
                <form name=alamat>
                Alamat:<br>
                <textarea name=alamat rows=4 cols=40>
                </textarea>
                </form>
</body>
</html>

Contoph Form 9
Button:
<input type=submit/reset value=caption>
Catatan:
type=submit, 
akan mendefinisikan sebagai tombol untuk menyerahkan umpan balik.
                type=reset, akan mendefinisikan tombol untuk menghapus isi formulir.

Contoh Form 10
Button:
<html>
<head>
                <title>Latihan 39</title>
</head>
<body>
                <form name=frm_submit method=post
action=latihan_39.html>
                Alamat:<br>
                <textarea name=alamat rows=4 cols=40>
                </textarea><br>
                <input type=submit value=Kirim>&nbsp;&nbsp;
                <input type=reset value=Reset>
                </form>
</body>
</html>


0 comments:

Post a comment

Translate

Arsip Blog

.comment-content a {display: none;}