Forum Moderators: coopster
I have written a script that deletes specified rows from my sql database.I use an html front page where i enter the name of the individual i would like to remove from the database.This works fine.However i would like it to confirm with me wheather or not the action should take place using a dialog box.How best can i do that?Any scrips in mind? Please assist....
Add this onclick script (whether it be on a link or a submit button, as it will execute the onclick first).
onClick="javascript:return confirm('do you really want to delete this item?')" Hope this helps
Ally
[edited by: Scally_Ally at 5:06 pm (utc) on Mar. 14, 2007]
As far as the user is concerned, when they "Delete" something it goes. But it's much easier for me to "Undelete" it when they realise they've made a mistake and want the data back.
I have included onClick="javascript:return confirm('do you really want to delete this item?')" and it worked well.In an attempt to have the name to be deleted iw wrote this:
onClick="javascript:return confirm('do you really want to delete <?php echo"$name";?>?')"
However this did not work.Please advice, where did i go wrong?And oh, i have defined the variable $name already.
Please advice and thanks.
but that shouldnt make any difference really.
It deffinately sounds like the variable is not being set. Try just echoing it out at the top of the page.
[edited by: Scally_Ally at 9:53 am (utc) on Mar. 20, 2007]