I'm using 2 autocomplete in my php form.1st for getting company names (from mysql) & 2nd for getting product names of selected company (from mysql). For example if i select company "A" then i need to get all the product name of company "A" only in 2nd autocomplete textfield.
Note : (This is possible in select menu but i'm using autocomplete because i have a record of more then 200 companies)
My javascript code for autocomplete :
<script>
$(document).ready(function() {
$("input#companyname").autocomplete({
source: [
<?php
while($rs = mysql_fetch_array($res))
{
$title = $rs['title'];
?>
"<?php echo $title; ?>" <?php echo ", "; ?>
<?php
}
?>
]
});
});
</script>