msgbox to confirm before delete

Have a asp/vbscript application where I need to have a client-side msgbox popup and confirm before a delete takes place.

If request.form("deletehospital"i) = "Delete Hospital" Then
   set conn=Server.CreateObject("ADODB.Connection")
   conn.Open "d:/basedata/xxx.mdb"
   sql="DELETE FROM hospital"
   sql=sql & " WHERE id=" & request.form("delhospid") & ""
  conn.Execute sql
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongSoftware Team Lead, ex-Business Systems Analyst , ex-Senior Application EngineerCommented:
>>Have a asp/vbscript application where I need to have a client-side msgbox popup and confirm before a delete takes place.

Client-side? Then you got to do it via Javascript instead on your form, try post your form here so that we can amend accordingly.
Loganathan NatarajanLAMP DeveloperCommented:
it can be done very well using client side?

you need to write the above code in the delete.asp file ... to be invoked when it is clicked ...

<script type="text/javascript">
function confirmation() {
        var answer = confirm("Are You Sure You Want To Delete This?")
        if (answer){
                return true;
                return false;
<a href="delete.asp" onclick="return confirmation()">DELETE</a>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ASP can't do what Javascript will do in this case.  You can however code a separate page and on click have it open the secondary page and there ask the user to confirm deletion.
chris_desboroughAuthor Commented:
Thanks logudotcom, perfect answer to my problem.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.