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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:04:27+00:00 2026-06-09T19:04:27+00:00

If a user clicks the delete user button, I display a modal window asking

  • 0

If a user clicks the delete user button, I display a modal window asking for confirmation of the delete. Within the modal window, if they click yes, then a function is called to delete the user (via ajax). If no, then the modal window is just closed. That is how it should work. But I don’t know how to pass the user ID to the yes button. Below is what I have so far to delete the user but it may be way off.

<div class="modal hide fade" id="DeleteUserModal">
<div class="modal-header">
    <button class="close" data-dismiss="modal">x</button>
    <h3>Delete User?</h3>
</div>
<div class="modal-body">
    <div class="row-fluid">
        <div class="span12">
            <p>Are you sure you want to permanently remove this user?</p>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <a href="javascript:deleteUser(#rsData.UserID#)" class="btn btn-danger">Yes, I'm sure</a>
            <button class="btn" type="submit" data-dismiss="modal">No way!</button>
        </div>            
    </div>
</div>
<div class="modal-footer">
    <a href="##" class="btn" data-dismiss="modal">Close</a>
</div>

I do not know how to pass the userid to this specific line in the above modal window:

<a href="javascript:deleteUser(#rsData.UserID#)" class="btn btn-danger">Yes, I'm sure</a>

While I am using jQuery, the answer can be written in JavaScript.

  • 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-06-09T19:04:28+00:00Added an answer on June 9, 2026 at 7:04 pm

    Use the data-attributes. They’ll make you happy. http://www.broken-links.com/2010/11/18/data-attributes-in-html-and-jquery/

    Rather give this node:

    <a href="javascript:deleteUser(#rsData.UserID#)" class="btn btn-danger">Yes, I'm sure</a>
    

    ..an id:

    <a id="delete-user-link" class="btn btn-danger">Yes, I'm sure</a>
    

    ..when you want to delete a specific user (thus click on the delete button in the list), set the data-attribute for the specific user-id:

    $(".delete-button").click(function(){
        $("#delete-user-link").data("user-id", $(this).data("user-id");
        // show the modal
    });
    

    this does require your delete-buttons (in the list) to have a data-attribute, like:

    <a class="btn" data-user-id="123">delete</a>
    

    and add a small jQuery method:

    $("#delete-user-link").click(function(){
        var userId = $(this).data("user-id");
        // do your delete stuff here
    });
    

    That should do the trick!

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

Sidebar

Related Questions

As soon as the user clicks the delete button my jQuery script asks the
What the program should do: After the user clicks the delete button with a
I have to display a popup when user clicks on Place button inside a
on form load, my datagridview display a datatable. once the user clicks the delete
I am trying to raise an exception if a user clicks the delete button
When the user clicks on a button, a new ListFragment is displayed. This fragment
When a user clicks a submit button I want the form to be submitted.
I have a View with Browse and Submit button.When the User Clicks on browse
I am displaying a JavaScript confirm box when the user clicks on the Delete
If I had the following code and the user was to click the delete

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.