ASP help needed....

06-09-2002, 10:55 PM
i have a few buttons on my asp page.. one of which is a "delete" button. i need to prompt the user whether to confirm delete or not.. hence i need a msgbox "yes" or "no"... Any one around can help??? Thankie!!!

06-09-2002, 10:59 PM
You can add some VBscript...

<Script Language = "VBScript">
Sub cmdGo_OnClick
Dim Response
Response = MsgBox("Are You Sure?", vbYesNo, "Some Title")

If Response = vbYes Then
End If

End Sub

06-10-2002, 06:11 PM
Here is an easy way to do it with JavaScript (works with any browser.)<a href="delete.asp" onClick="if(!confirm('Are you sure you want to delete this thingy?')) return false;">Delete</a>

06-10-2002, 09:38 PM
hey thanks guys... sorry to say that i can't figure out the codes u all gave me... i tried to use the java script but it could only prompt me whether to delete or not.. however when i choose yes, it doesn't bring me to the desired page.... can i use the "window.location.href" thing? oh yah, the delete thingy is a button... please help.. =)

06-10-2002, 09:52 PM
My above code for the hyperlink works. BUT, if you want to do it with a button, do this:<input type=submit onClick="if(confirm('Are you sure you want to delete this thingy?')) window.location='delete.asp';">

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum