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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:51:44+00:00 2026-05-12T06:51:44+00:00

Im not proficient in JS myself very much, so it would probably take me

  • 0

Im not proficient in JS myself very much, so it would probably take me a few hours to figure this out myself, so I figured I’d ask you guys.

I have Delete/Ban links on my site, that are used by admins to moderate the users and what they post. Since these links have such drastic consequences on the site’s content I would want to have some sort of confirmation that would popup when one of the links is clicked.

It should have some extra text explaining what’s about to happen, and OK/Cancel buttons.

So I have a link, for example like this:

<a href="ban.php?id=123" class="confirm_ban">Ban John</a>
<a href="delete.php?id=123" class="confirm_delete">Delete Post</a>

When this link is clicked, the code needs to be triggered. If OK is pressed, it goes to ban.php?id=123, if Cancel is pressed, it doesn’t go anywhere.

A simple JS dialog box, will do. Or if you have a link for a fancy jquery powered box, you can point me towards that also.

Thanks!

  • 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-12T06:51:44+00:00Added an answer on May 12, 2026 at 6:51 am

    Easiest way to achieve this is to use the confirm() function:

    var confirmed = confirm('Do you really want to do this?');
    if(confirmed) {
        //Do dangerous action
    }
    

    It basically displays a box with the text you provide and ok and cancel buttons.

    With a link you can do something like this:

    <a href="someurl" onclick="return confirm('Are you sure?');">
    

    It’s not best possible practices to put the action in the onclick like that, but it works and is simple to understand even if you’re not a pro javascripter

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

Sidebar

Related Questions

I'm not very proficient with AJAX but by all accounts I think this should
Not sure how to ask a followup on SO, but this is in reference
I am not very proficient in Mac OS X programming, but I am working
Not very technical, but... I have to implement a bad words filter in a
Not sure if this is possible or if I'm expressing correctly what I'm looking
Not quite sure how to troubleshoot this. I'm maintaining an ASP site, its mostly
I have not found a regexp to do this. I need to validate the
Since I'm not really proficient with databases, some details may be irrlevant, but I'll
(Not related to versioning the database schema) Applications that interfaces with databases often have
Not really getting the point of the map function. Can anyone explain with examples

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.