Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to put an alert box for delete button

Posted on 2006-04-03
6
Medium Priority
?
242 Views
Last Modified: 2010-04-17
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
0
Comment
Question by:royalcyber
  • 4
  • 2
6 Comments
 
LVL 3

Expert Comment

by:rairdonm
ID: 16363415
server technology and scripting language?
0
 
LVL 3

Expert Comment

by:rairdonm
ID: 16363461
example
<a href="#" onclick="customConfirm('remove.asp?ID=<%
=server.URLEncode(RS("ID"))%>');return false">Remove</a>
0
 

Author Comment

by:royalcyber
ID: 16363657
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

Thanks
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Accepted Solution

by:
rairdonm earned 2000 total points
ID: 16372147
<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.
0
 

Author Comment

by:royalcyber
ID: 16372509
Thanks it works
0
 
LVL 3

Expert Comment

by:rairdonm
ID: 16372552
Welcome
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question