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

  • SEARCH
  • Home
  • 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 6215641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:05:39+00:00 2026-05-24T07:05:39+00:00

I currently have a page which utilizes a mix of PHP, JQuery and Ajax.

  • 0

I currently have a page which utilizes a mix of PHP, JQuery and Ajax. The page displays a table of items, with corresponding anchors next to each item (row) to View Details, Edit, or Delete that specific item.

When the page initially loads, it makes a call via Jquery/Ajax to populate the table, and appends the item ID to the URL of each item’s anchor (ex:<a id="myanchorid" href="viewdetails.php?id=5">) Instead of taking the user to a new page, I want to be able to use Jquery’s dialogue function to open the page in a dialogue pop-up.

The problem I’m running into is that in order to properly call my Jquery function, I obviously need an unique ID for each anchor, but since I don’t know how many items I’ll have when the page loads, and that each item’s ID could be any number I’m stumped as to how to create anchor tags with IDs that I can them pass to my dialogue function.

Thanks!

I’m currently using the following function:

$(document).ready(function(){
 function yourfunction(event) {
           alert($('#myanchorid').attr('href')); 
          //$("#dialog").load(/getEventNameById/').dialog(); //will add item ID here
         return false;
    }


$('#myanchorid').live('click',yourfunction); //need myanchorid to dynamically be passed...myanchorid1, myanchorid2...

});
  • 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-24T07:05:39+00:00Added an answer on May 24, 2026 at 7:05 am

    You can use HTML5 data attributes:

    <a href="viewdetails.php?id=5" data-id="5" class="view_more">Click to view</a>
    

    And then:

    $('.view_more').click(function()
    {
        id = $(this).data('id') // should yield 5
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a page defined which displays some data in rows. At the
I currently have a PHP page in which there a couple of div elements
I currently have a page which is declared as follows: public partial class MyPage
I have a POS web application which currently executes a java applet on page
I currently have pagination functionality that displays the total page count, but I was
I currently have a page in which users can drag content around, resize it,
We currently have a quote page which lists all existing quotes that we would
I have a page which displays the model details(in this case Franchise), but also
Scenario: I have a page which contains a dropdownlist and a table which contains
I currently have an asp.net page which a loggd in user goes to and

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.