<form method=post action="proses_input.php">...</form>.
FORMULIR INPUT TYPE TEXT (input teks pendek)
<form method=post action="proses_input.php">
Nama Situs:<br><input type="text" name="nama_situs" size="30"><br>
Url:<br><input type="text" name="url" size="30"><br>
Email:<br><input type="text" name="email" size="40"><br>
<input type="submit" value="kirim">
</form>
Tampilan:FORMULIR INPUT TYPE PASSWORD (input teks dengan tampilan password)
Sintak HTML<form method=post action="proses_input.php">
Password:<br>
<input name="pass_kamu" size="30" type="password"><br>
<input type="submit" value="kirim"></form>
TampilanPassword:<br>
<input name="pass_kamu" size="30" type="password"><br>
<input type="submit" value="kirim"></form>
FORMULIR INPUT TYPE TEXTAREA (input teks lebih panjang)
Sintak HTML
<form action="proses_input.php" method="post">
Deskripsi Situs:<br>
<textarea cols="40" name="deskripsi" rows="4"></textarea><br>
<input type="submit" value="Kirim"></form>
Tampilan
FORMULIR INPUT TYPE RADIO (input pilihan salah satu)
<form action="proses_input.php" method="post">
Jenis Situs:<br>
<input name="jenis_situs" value="Website" type="radio" CHECKED>Website
<input name="jenis_situs" value="Blog" type="radio">Blog
<input type="submit" value="kirim"></form>
Tampilan<input type="submit" value="kirim"></form>
FORMULIR INPUT TYPE CHECKBOX (input pilihan bisa lebih dari satu)
Sintak HTML<form action="proses_input.php" method="post">
Kategori:<br>
<input name="kategori" type="checkbox" value="Gallery" checked>Gallery
<input name="kategori" type="checkbox" value="Hobby">Hobby
<input name="kategori" type="checkbox" value="pribadi">Pribadi
<input type="submit" value="kirim">
</form>
TampilanFORMULIR TYPE SELECT (input pilihan salah satu)
<form action="proses_input.php" method="post">
Jenis Pengunjung:<br>
<select name="jenis_pengunjung">
<option selected>Anak-anak </option>
<option>Dewasa </option>
<option>Semua Umur </option>
</select>
<input type="submit" value="Kirim">
</form>
TampilanFORMULIR TYPE FILE (upload foto)
Sintak HTML
Sintak HTML
<form action="proses_input.php" enctype="multipart/from-data" method="post">
Logo Situs:<br>
<input name="foto" type="file">
<input type="submit" value="Kirim">
</form>
TampilanLogo Situs:<br>
<input name="foto" type="file">
<input type="submit" value="Kirim">
</form>
CONTOH FORMULIR YANG SUDAH DIGABUNGKAN DARI BERBAGAI TYPE
Sintak HTML Formulir diatas sbb:
0 komentar:
Posting Komentar