Delete confirmation for dummies

On my page, I have a delete button. But when I press trhe button to delete, I put a standard javascript confirm pop-up window with a “Are you sure…”
How do I change the message to read “Are you sure you want to delete the member firstName, LastName”? So that an idiot would know who they are deleting?

In members.php you have a script as follows:
// -----------
function confirmSubmit()
var agree=confirm(“Are you sure you wish to delete this member (This step cannot be undone)?”);
if (agree)
return true ;
return false ;
// ----------

You can change the message in the first line.

I wouldn’t use a submit button here. These are normally used to submit a form. A normal button with an onclick handler would be a better option.

I’m not sure If I would use javascript in this page in the first place. The action on my form in this case would be delete_a_member.php in that page you can display the members information with a form above displaying any text you want and a delete button(submit) and a cancel button(button). When the delete button is presses the actual action takes place, if the cancel button is pressed you use javascript:history.back()

Another very good reason for javascript scripting to not be the only means to display the warning, is that people with scripting disabled will be completely unable to perform the task.

If you first provide a way to do it without any scripting being involved, you can then use scripting to override some of those techniques and enhance the experience for the user.

It also guarantees that your site continues to work no matter whether scripting is disabled or not.