View Full Version : popup confirm in asp

06-24-2007, 02:15 PM
what's the best way to do a confirm in asp?

meaning i'm processing a page and if I find that a record exists I want to give the user an option -- to either add record or cancel. if it doesn't exist it will just add the record.

What's the best and easiest way to do this?

06-25-2007, 02:21 PM
The EASIEST way, or the cross-browser, standards-compliant way?

The easiest way is to use IE's MsgBox() function. However, this doesn't work in non-IE browsers.

The cross-browser, standards-compliant way is to use JavaScript.

When your code determines if an update is needed, do a

<script language="javascript">
function confirm() {
var agree = confirm('This record already exists. Would you like to update the record?');

if(agree) {
'run some extra code here