Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    May 2004
    Thanked 0 Times in 0 Posts

    popup confirm in asp

    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?

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Thanked 19 Times in 19 Posts
    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
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts