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 7191151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:40:05+00:00 2026-05-28T19:40:05+00:00

How do i call a jquery dialog box from a div in a loop?

  • 0

How do i call a jquery dialog box from a div in a loop?

See for instance, clicking the <p> will show up the profile of selected database user.

Ex:

<div id="db-users">

   <div id="user-info1"> //db userinfo 1
     <p>ID#001 John Smith</p>
     <div id="dialog-box">Profile of John Smith</div>
   </div>

   <div id="user-info2"> //db userinfo 2
      <p>ID#002 John Doe</p>
      <div id="dialog-box">Profile of John Doe</div>
   </div>

</div>

EDIT: By the way , here is what i have done so far

$('p').click(function() {
        $('#dialog-box').dialog({

       modal: true,
       width:560,
       height: 500,
       draggable: false,
       buttons: {
        Close: function() {
              $( this ).dialog( "close" );
        }
       }
    });
});

Only one dialog box is showing up, only for John Smith. I don’t have the idea to come up the desired output. Any help would much appreciated. Thanks.

EDIT 2: I added IDs to all div, to identify each div. Now, using jquery, how to implement q dialog box to show up the info when Name is clicked?

  • 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-28T19:40:06+00:00Added an answer on May 28, 2026 at 7:40 pm

    Remove all the IDs from the HTML except for the db-users.

    The classes aren’t really required either, but you can leave them in if you’re using them for styling.

    Your HTML will look like this:

    <div id="db-users">
        <div> <!-- db userinfo 1 -->
            <p>ID#001 John Smith</p>
            <div>Profile of John Smith</div>
        </div>
    
        <div> <!-- db userinfo 2 -->
            <p>ID#002 John Doe</p>
            <div>Profile of John Doe</div>
        </div>
    </div>
    

    Then in your jQuery (assuming 1.7):

    $('#db-users p').on('click', function(e) {
        $(this).next('div').dialog({
            ... your dialog options ...
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i would like to call a jquery dialog box (so html, css,javascript ) via
I have a jQuery dialog box that opens and then an AJAX call is
I'm trying to add a close a jquery ui dialog box from an ajax
I want to create a jQuery dialog from HTML returned by an AJAX call.
I'm attempting to do an AJAX call (via JQuery) that will initiate a fairly
I am getting an error in an ajax call from jQuery. Here is my
i've used .load() with jquery to call a php file that will return search
jqueryui is used to show a dialog box, then if there is a click
I have a jQuery UI Dialog box, that I'm creating. It starts out as
I am working with JQuery dialog which is opened before an ajax call 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.