mohon dibantu ya,
kemarin pertanyaan saya, 1 combobox ke 2 textbox.
gimana kalau comboboxnya diganti dengan textbox (autocomplete)
berikut koding saya
<h4> Tambah Mata Kuliah </h4>
<form method=post action=?menu=create_makul1>
<table border=1>
<tr>
<td> ID Makul </td>
<td> : </td>
<td> <input type=text name=id_makul maxlength=10> </td>
</tr>
<tr>
<td> Mata Kuliah </td>
<td> : </td>
<td> <input type=text name=makul maxlength=100> </td>
</tr>
<tr>
<td> Semester </td>
<td> : </td>
<td> <select name="smi">
<option value="I">- I</option>
<option value="II">- II</option>
<option value="III">- III</option>
<option value="IV">- IV</option>
<option value="V">- V</option>
<option value="VI">- VI</option>
<option value="VII">- VII</option>
<option value="VIII">- VIII</option>
</select>
</td>
</td>
</tr>
<tr>
<td> SKS </td>
<td> : </td>
<td> <input type=text name=sks maxlength=100> </td>
</tr>
<tr>
<td> Prodi </td>
<td> : </td>
<td> <select name=id_prodi>
<?php
include "koneksi/koneksi.php";
$sql1 = mysql_query("select * from prodi order by nama1");
while ($data = mysql_fetch_array($sql1)){
//echo "<option value="" selected="selected">- Silahkan Pilih Kota -</option>";
echo "<option value='$data[id_prodi]'> $data[nama1] </option>";
}
?>
</select>
</td>
</tr>
<tr>
<td> Pengajar </td>
<td> : </td>
<td> <select name=id_pengajar>
<?php
include "koneksi/koneksi.php";
$sql1 = mysql_query("select * from pengajar order by pengajar");
while ($data = mysql_fetch_array($sql1)){
//echo "<option value="" selected="selected">- Silahkan Pilih Kota -</option>";
echo "<option value='$data[id_pengajar]'> $data[pengajar] </option>";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan=3> <input type=submit value=Simpan> <input type=submit value=Batal onClick=history.back()> </td>
</tr>
</table>
</form>
<?
include "koneksi/koneksi.php";
$offset=$_GET['offset'];
$totalquery=mysql_query("select * from mak");
$numrows=mysql_num_rows($totalquery);
//jumlah data yang ditampilkan perpage
$limit = 10;
if (empty ($offset)) {
$offset = 0;
}
if ($numrows == 0) {
echo "<br><center> Tidak Ada Data makul </center>";
}
else {
?>
<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30"">
<div align="left"><font size="3" face="tahoma">Data makul</font><br> Jumlah Data : <?php echo "$numrows" ;?> </div>
</td>
</tr>
</table>
<?php
// panggil semua data dari tabel makul diurutkan berdasarkan id makul, dibatasi dengan limit = 15
$hasil1 = mysql_query("select * from mak, pengajar where pengajar.id_pengajar=mak.id_pengajar limit $offset,$limit");
$k = 1;
$k = 1 + $offset;
echo"
<div align=left>
<table border=1 width=100%>
<tr>
<th> No. </th>
<th> ID Makul </th>
<th> makul </th>
<th> SKS </th>
<th> Pengajar </th>
<th width=70> Aksi </th>
</tr>
";
while ($data = mysql_fetch_array($hasil1)) {
echo"
<tr>
<td width=10 align=center> $k </td>
<td> $data[id_makul] </td>
<td> $data[makul] </td>
<td> $data[sks] </td>
<td> $data[pengajar] </td>
<td> <a href=index.php?menu=edit_makul&id_makul=$data[id_makul] title='Edit makul'> Edit </a> | <a href=index.php?menu=hapus_mak&id_makul=$data[id_makul] title='Hapus makul'> Hapus </a> </td>
</tr>
";
$k++;
}
//untuk tutup tabel
echo "</table>";
echo "<div class=paging>";
if ($offset!=0) {
$prevoffset = $offset-10;
echo "<span class=prevnext> <a href=$PHP_SELF?menu=makul&offset=$prevoffset>Back</a></span>";
}
else {
echo "<span class=disabled>Back</span>";//cetak halaman tanpa link
}
//hitung jumlah halaman
$halaman = intval($numrows/$limit);//Pembulatan
if ($numrows%$limit){
$halaman++;
}
for($i=1;$i<=$halaman;$i++){
$newoffset = $limit * ($i-1);
if($offset!=$newoffset){
echo "<a href=$PHP_SELF?menu=makul&offset=$newoffset>$i</a>";
//cetak halaman
}
else {
echo "<span class=current>".$i."</span>";//cetak halaman tanpa link
}
}
//cek halaman akhir
if(!(($offset/$limit)+1==$halaman) && $halaman !=1){
//jika bukan halaman terakhir maka berikan next
$newoffset = $offset + $limit;
echo "<span class=prevnext><a href=$PHP_SELF?menu=makul&offset=$newoffset>Next</a>";
}
else {
echo "<span class=disabled>Next</span>";//cetak halaman tanpa link
}
}
echo "</div";
echo "</font>";
?>
ditolong ya Mas, Master2
Regards,