Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirm "Delete" action.

Status
Not open for further replies.

JeroenDortmans

Technical User
Aug 7, 2001
56
NL
I have a button which sends an ID to a delete page so the record with this ID is deleted.
Now I want to have a confirm message box in-between the button click and sending it to the delete page.
How can I do this with VBS (It is for an Intranet where only IE is used).
Can someone give me an example including the part of calling the message box from the button click?
 
You're looking for the msgBox function with vbOkCancel as the parameter. Go:


for all you'll need to know.

:)
paul
penny.gif
penny.gif
 
Thank you for this great link.
The thing I want to know now. When I click the "Ok" or "Yes" button, the script must send an ID as a parameter to a "delete.asp" page.
How does this code look like
 
Well, you build the function (in vbScript) to send the parameter. For instance, maybe you have a function that has to return a value in order for a form to submit (thereby sending the value). Then, it might look something like this (in pseudocode. I could show you real code for javascript, but not familiar with client side vbScript):

function submitForm()
if msgBox(yourStuffHere) then
'submit the form
else
'don't submit the form
end if
end function

So that you use the msgbox as a conditional statement, and when the user clicks yes or no, it returns a value to this function (true or false), which you evaluate in order to know what to do.

hope that helps! :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top