I have a side-menu with labels under it define the menu-items and are dynamically generated. When user-clicks on any item, following code must execute:
$("#label").click( function(event) ){
$.get(
"../../phplibraries/productlist.php",
{
ControlName: 'ulCategoryName',
Category: 'Beverages'
},
function(data) {
$('#divList').html(data);
});
});
I am not following how to capture click on any label that is actually a menu item.
-- Edited --
The HTML of side menu is as below:
<?php
error_reporting(E_ALL^E_NOTICE);
ini_set('display_errors', '1');
require_once('dbaccess.php');
$ulName = $_GET['ControlName'];
$category = $_GET['Category'];
$result=mysql_query("SELECT pname FROM products WHERE category='".$category."'");
?>
<ul id="<?php echo $ulName; ?>" name="<?php echo $ulName; ?>">
<?php while($row=mysql_fetch_array($result))
{ ?>
<label id="lblCategory" name="lblCategory" style="font-size:medium;"><?php echo $row[1]; ?></label><br />
<!--<li style="font-size:medium;"><?php echo $row[1]; ?></li>-->
<?php } ?>
</ul>