0

Hi ,

I want to confirm a delete function using javascript .. In detail

I want to display a list using php Mysql as follows

No + Name +
----------------------------------
1. + Raj + Delete
2. + Raj2 + Delete
----------------------------------

When user clicks on Delete button that will leads to another php page which contains directions for deleting that entry.

But before that I want to do a confirmation which saying "Are you sure want to delete ? "

When user clicks on OK button that will continue to delete function and otherwise that will cancel..

Please help me how we can do this with Javascript

Thanks in advance
Rajeesh

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Akash Saikia
0

Put a onClick in the delete button
example

<input type="button" value="Delete" onclick="return confirm('Are you sure you want to delete?');)">

What it will do is ,it will show you confirm,so if you click yes,there confirm returns 'true'. So if true is returned write some php code there,else do some other stuff.

0

Thanks for the reply ..

Thanks

Put a onClick in the delete button
example

<input type="button" value="Delete" onclick="return confirm('Are you sure you want to delete?');)">

What it will do is ,it will show you confirm,so if you click yes,there confirm returns 'true'. So if true is returned write some php code there,else do some other stuff.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.