boleh minta tolong di cek, kak mana yang salah ya?
get_data.php
<?php
$id_pelanggan = $_GET['term'];
$conn = mysql_connect("localhost","root","");
mysql_select_db("db_denisputrae");
$sql = "select * from daftar_kolektif where id_pelanggan like '$id_pelanggan%'";
$hs = mysql_query($sql);
$json = array();
while($rs = mysql_fetch_array($hs)){
$json[] = array(
'label' => $rs['id_pelanggan'],
'value' => $rs['id_pelanggan'],
'nama_pelanggan' => $rs['nama_pelanggan'],
'alamat_rumah' => $rs['alamat_rumah']
);
}
header("Content-Type: application/json");
echo json_encode($json);
ini formnya, form_instalasi.php
<?php
session_start();
if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
echo " <center>Untuk mengakses modul, Anda harus login <br>";
echo "<a href=login_admin.php><b>LOGIN</b></a></center>";
}
else{
include "config/koneksi.php";
include "top.php";?>
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript" src="config/jquery-1.10.2.js"></script>
<script type="text/javascript" src="config/jquery.validate.js"></script>
<style type="text/css">
.error { font-size:small; color:red; }
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#instalasi').validate();
});
$('#instalasi').validate({
rules: {
id_pelanggan : {
digits: true,
},
id_petugas : {
digits: true,
},
},
messages: {
id_pelanggan: {
required: "Kolom id harus diisi",
},
id_petugas: {
required: "Kolom id harus diisi",
},
}
});
</script>
</head>
<body>
<?php
echo "<center><h2>Tambah Data Instalasi</h2></center>"; ?>
<form method="POST" name="instalasi" id="instalasi" action="input_instalasi.php">
<center>
<table>
<tr><td>ID Pelanggan</td> <td> : <input type="text" name="id_pelanggan" size="30" class="required"></td></tr>
<tr><td>Nama Pelanggan</td> <td> : <input type="text" name="nama_pelanggan" size="30" class="required"></td></tr>
<tr><td>Alamat</td> <td> : <textarea name="alamat_rumah" cols=30 rows=3 class="required"></textarea></td></tr>
<tr><td>ID Petugas</td> <td> : <input type="text" name="id_petugas" size="30" class="required"></td></tr>
<tr><td>Nama Petugas</td> <td> : <input type="text" name="nama_petugas" size="30" class="required"></td></tr>
<tr><td>Tanggal Instalasi</td> <td> : <input type="text" name='tanggal_instalasi' class="required"><a href='javascript:void(0)'
onClick='if(self.gfPop)gfPop.fPopCalendar(document.instalasi.tanggal_instalasi);
return false;'><img name='popcal' align='absmiddle' style='border:none'
src='./calender/calender.jpeg' width='34' height='29' border='0' alt=''></a></td></tr>
<tr><td><td colspan=2> <input type='submit' value='Simpan'>
<input type='button' value='Batal' onclick='self.history.back()'></td></td></tr>
</table></form></center></body>
<script>
$(function() {
$( "#id_pelanggan" ).autocomplete({
source: "get_data.php",
minLength: 2,
select: function( event, ui ) {
$('#nama_pelanggan').val(ui.item.nama_pelanggan);
}
});
});
</script>
<!-- PopCalendar(tag name and id must match) Tags should not be enclosed in tags other than the html body tag. -->
<iframe width="174" height="189" name="gToday:normal:./calender/agenda.js" id="gToday:normal:./calender/agenda.js" src="./calender/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>
<?php
}
?>
kenapa ga bisa ya ka? padahal coba code dari kaka bisa ko walaupun value diganti. makasih sebelumnya