I have the following hook_menu:
$items['products/autocomplete.json/%'] = array(
'page callback' => 'json_list_products',
'access arguments' => array('access products')
);
Here is the function:
function json_list_products($keywords) {
$items = array();
foreach(_sql_select_products($keywords) as $product) {
$items[$product['Product_ID']] = $product['Product_Name'];
}
drupal_json_output($items);
}
$keywords is not populated with the value of the % as i suspected - how do I populate this value?
Alex