Forums

This topic is locked

Confirmation when deleting record

Posted 23 Jun 2003 13:04:16
1
has voted
23 Jun 2003 13:04:16 Wayne Hultum posted:
Hi all,

I’m working on a site at the minute where the user is able to add items to sell. When they’ve added the item it appears in their item list page with a tick box that enables them to delete it.

At the moment if you delete an item it doesn’t give you a warning that you are going to delete it. What I want to do is when you tick the box and click the delete button a popup box appears with a confirmation message asking if they are sure they want to delete it.

Hope I’ve explained this enough

Thanks in advance

Wayne

Replies

Replied 23 Jun 2003 14:08:15
23 Jun 2003 14:08:15 Vince Baker replied:
Place this code in the head of your document

<script language="JavaScript" type="text/JavaScript">
<!--
function ConfirmDel(msg) {
document.MM_returnValue = confirm(msg);
}
//-->
</script>

and place this in the tag of your form (after the <form line of code)

onClick="ConfirmDel('Are you sure you want to delete this record?');return document.MM_returnValue"

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 04 Jul 2003 03:35:53
04 Jul 2003 03:35:53 David Behan replied:
DW has its own in built behaviour for this. Click the delete button you created so that it is highlighted. Goto your behaviours panel and click the + symbol. Now select popup confirm message. Enter the question you want to ask the user, e.g. Are you sure? and thats it.

Regards,

Dave

_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.dynamic.ie
Replied 08 Jul 2003 10:56:12
08 Jul 2003 10:56:12 Wayne Hultum replied:
Thanks, that works fine if they want to delete their record. What I want to do is give them the option to confirm they want to delete and also give them the option to cancel there delete.

Is there a way I can do that?

Thanks again
Replied 08 Jul 2003 14:02:08
08 Jul 2003 14:02:08 David Behan replied:
It is included in that function in DW. It asks them a question (e.g. Are you sure?) and they can press OK or CANCEL. OK continues with the script while CANCEL goes back to where they were without doing anything.

Regards,

Dave

_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.dynamic.ie

Reply to this topic