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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:34:52+00:00 2026-05-12T07:34:52+00:00

My question is how to pull the username into the confirmation popup… would I

  • 0

My question is how to pull the username into the confirmation popup… would I have to change the way my php is generating the list of users or would it need some mootools coding to select the parent and then the username… if so how could I achieve that?

I have my PHP code using codeigniter to generate the following kinda things which is basically listing a username and a link to delete the user.

<div class='item'> 
<a href="http://localhost/nstrust/index.php/admin/users/delete/9" class="delete">Delete</a> <a href="http://localhost/nstrust/index.php/admin/users/view/9" class="view">Jamalia</a>
</div> 
<div class='item'> 
<a href="http://localhost/nstrust/index.php/admin/users/delete/13" class="delete">Delete</a> <a href="http://localhost/nstrust/index.php/admin/users/view/13" class="view">Timothy</a>
</div> 

I have the following mootools code to pop up and confirmation to see if the user really want to delete the user

 window.addEvent('domready', function()
 {
    $$('a.delete').addEvent('click', function(event)
    {
        if (!confirm("Are you sure you want to remove this user?"))
        {
            event.stop();
        }
    });
 });
  • 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-12T07:34:52+00:00Added an answer on May 12, 2026 at 7:34 am

    The following will work nicely on your markup:

    $$('a.delete').addEvent('click', function(event) {
      var username = $(event.target).getNext().get('text'); //The username is in the next tag.
      if (!confirm("Are you sure you want to remove " + username + "?")) {
        event.stop();
      }
    });
    

    Since the next link holds the user name, you can simply traverse the DOM to it and get the text value.

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

Sidebar

Related Questions

The question is this. I have a number of persisted objects that I'll pull
I have a simple question. Is there a command that allows you to pull
I have three tables to define users: USER: user_id (int), username (varchar) USER_METADATA_FIELD: user_metadata_field_id
ASP.NET newbie question - fastest fingers! I have a page that needs to pull
I am new to programming and I have a question about how to pull
This question is Part 2 of PHP's preg_match_all() to pull out all php tags
I have an XML array that I access to pull a random question from.
This question is complicated so examples would work best...I have the following table on
Question about the m2 eclipse plugin. Currently I have Eclipse Java EE IDE for
Question is about what is the best way to create vector of vector s.

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.