Solved

Confirmation box before delete

Posted on 2011-03-15
2
464 Views
Last Modified: 2012-05-11
Hi
I have”Delete” text as a link (please see the code bellow). When you click on the Delete sends id-delnumber to delete function. I will make it that appears a message box and ask if you sure? Yes and No, before the delete-id sends to the delete function.

<?php   echo "<a href=lastnews.php?id-delnumber=".$row["id"]."> Delete </a>"; ?>
0
Comment
Question by:sam20
2 Comments
 
LVL 8

Accepted Solution

by:
Rik-Legger earned 500 total points
Comment Utility
It is a little bit hard to read what you exactly want,
but i think you mean something like this:

<?php   
echo "<a href=lastnews.php?id-delnumber=".$row["id"]." onclick=\"if (confirm('Are you sure you want to delete?')) { return true;  }; return false;\"> Delete </a>"; 
?>

Open in new window

0
 

Author Closing Comment

by:sam20
Comment Utility
Thank you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now