Confirm delete from form button

Hello.

How can I add a confirmation box?

An alert box that says: "Are you sure you want to delete this?"

Thanks!

<input name="dele" type="button" value="delete this entry" onClick="passthis('managedbl.php?ac=del')">

LVL 16
hankknightAsked:
Who is Participating?
 
pvginkelCommented:
This should work:

<input name="dele" type="button" value="delete this entry" onClick="if (window.confirm('Are you sure?')) { passthis('managedbl.php?ac=del'); }">
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.