Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 548649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:06:06+00:00 2026-05-13T11:06:06+00:00

I have a side-menu with labels under it define the menu-items and are dynamically

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:06:06+00:00Added an answer on May 13, 2026 at 11:06 am

    if you need dynamically loaded labels to get the behavior you described consider using jQuery live().
    in general, you could define your behavior to certain elements, with the needed selector, when creating the menu, and all dynamically created elements who answer to this selector will gain the same behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have simple side menu with this html code : <div id=menu> <div> Menu
I have a ul/li based side menu, styled with two CSS rules, the following
I Have site change.is, where right side menu & search bar in header is
In my Java EE application page, I have header.jsp, a side menu.jsp, a body.jsp
I have my server side code create an event on Facebook, using a Facebook
I have a server-side code using .NET Remoting to establish the connection with client.
I have a side bar menu composed of ul->li->a, styled with css to look
I'm new to JQuery, I have a dynamic side menu (links have the class
In my project i have a side menu from which I am redirecting to
I have a side navigation menu that I want to be able to utilize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.