jQuery のプラグインに問題があり、結果が表示されません。どこで間違えたのかわからない?
それは私のnewJob.phpです:
<form method="post" action="newJob.php">
<span>Customer Name:<input type="text" id="customerName" name="customerName"></span><br>
<input type="submit" name="submitJob" value="Create Job" >
</form>
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jquery-ui.js"></script>
<script type="text/javascript" src="../js/startDate.js"></script>
<script type="text/javascript">
$(function() {
//autocomplete
$("#customerName").autocomplete({
source: "searchCustomer.php",
minLength: 1
});
});
</script>
私のsearchCustomer.php:
<?php
include('classes.php');
$obj = new CompanyDatabase;
$obj->connect_db();
$obj->select_db();
if (isset($_POST['customerName'])) {
$query = $_POST['customerName'];
$sql = mysql_query ("SELECT `Customer Name` FROM `job` WHERE `Customer Name` LIKE \"%".$query."%\"");
$array = array();
while ($row = mysql_fetch_assoc($sql)) {
$array[] = $row['customerName'];
}
echo json_encode ($array); //Return the JSON Array
}
?>
どうしたの?ご協力いただきありがとうございます!