Hello all,

I am not sure if I should post this in this forum or the PHP forum. Basically, I am designing a web application for a school project. On the delete action, I want to prompt the user to make sure they mean delete. I was wanting to use the javascript function alert() but I am open to other suggestions. I am having bad luck googling how to use the alert to prevent my php script from continuing. Can someone either point me to some good reading on this or explain how I can uses this action to act as a Boolean for continuing, thanks,

8 Years
Discussion Span
Last Post by Roebuc

You can do something like this

<form action="delete.php or whatever" onsubmit="return confirm('Are you sure?');">

That will pop open a box that says "Are you sure?" with yes and no buttons, if the user clicks no then the form won't submit and nothing will happen, if they click yes the form submits as it should.

Votes + Comments
Thanks! Sorry for the long wait on it though.

Apparently, I never marked this as solved. Sorry, setting to solved and giving Kudos! This answered my question. Thanks.

This question has already been answered. 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.