Solved

Confirmation box before delete

Posted on 2011-03-15
2
470 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
ID: 35138951
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
ID: 35139123
Thank you
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

786 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