How to put an alert box for delete button

I have an edit link in a form which calls a server side page to delete a specific record. What I need is an alert box before calling the server side page, if the user enter yes it should call the page and pass the "ID" and if the user clicks on No do nothing. Can anyoe please help in how to implement this

Any help will be greatly appreciated
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.

server technology and scripting language?
<a href="#" onclick="customConfirm('remove.asp?ID=<%
=server.URLEncode(RS("ID"))%>');return false">Remove</a>
royalcyberAuthor Commented:
I am using JSP and javascript.

here is my code

<td><a href="chapter_admin?action=delete_events&eid2=<%= next_event.getEvents_ID() %>">remove</td>

Couple of quick questions
So should I make a javascipt function or JSP method named customConfirm and why do you have return false at the end of the tag.
Also if you would have any example I can look over, it will be greatly helpful

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

<a href="chapter_admin?action=delete_events&eid2=<%= next_event.getEvents_ID() %>" onclick="javascript:return confirm('Are you sure you want to delete this record ?')"><BR>
Delete this record</a>

you use the return false to (do nothing)...but the code I just pasted is better.

You can use confirm for BUTTONS (on forms) and add IF statemsnts.

If you wanted to delete multiple records, then yes, you'd have to create a jsp page that takes in the "GET" or "POST" variables and deletes the records.  You would confirm() on the submit button.

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
royalcyberAuthor Commented:
Thanks it works
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.