473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Simple Confirmation Code for a Delete Button

I've used a simple javascript for some time (no entries required up in
the <head> tag) that asks for a confirmation before deleting.

ie.
<a href="/delete.asp?which=345 %>" onclick="javascript:return
confirm('Are you ABSOLUTELY SURE you want to DELETE this record
?')">Delete record</a>

On several sites I use short form constructs to generate a more
recognizable button, and would like to use a simple script such as
this to give the conformation option.

ie.
<form action="delete2.asp" method="post">
<input type="hidden" name="which2" value=345">
<input type="submit" value="Delete">

Could this script be modified.?

Any alternative.?

.les.

Aug 4 '05 #1
2 3062
On Thu, 04 Aug 2005 04:53:07 GMT, le*****@anti-spam.iafrica.com (Les
Juby) wrote:
onclick="javascript:return
confirm('Are you ABSOLUTELY SURE you want to DELETE this record
?')"


OK. I worked it out......

onclick gets replaced by onsubmit !!!!

.les.

Aug 4 '05 #2
in article 42**************@news.telkomsa.net, Les Juby at
le*****@anti-spam.iafrica.com wrote on 8/3/05 9:53 PM:
I've used a simple javascript for some time (no entries required up in
the <head> tag) that asks for a confirmation before deleting.

ie.
<a href="/delete.asp?which=345 %>" onclick="javascript:return
confirm('Are you ABSOLUTELY SURE you want to DELETE this record
?')">Delete record</a>

On several sites I use short form constructs to generate a more
recognizable button, and would like to use a simple script such as
this to give the conformation option.

ie.
<form action="delete2.asp" method="post">
<input type="hidden" name="which2" value=345">
<input type="submit" value="Delete">

Could this script be modified.?

Any alternative.?

.les.

Sure it could.

Either

<form action="delete2.asp" method="post" onsubmit="return confirm('Are you
ABSOLUTELY SURE you want to DELETE this record ?');">

OR

<input type="submit" value="Delete"onclick="javascript:return
confirm('Are you ABSOLUTELY SURE you want to DELETE this record ?')">
HTH,

--Steffan

Aug 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Smith | last post by:
Hello all, I don't know c# that well and thus need urget help. I have a page that displays files from an access database that has a button to be delet file from database. I need a confirmation...
3
by: Dennis Allen | last post by:
Hi. On my online ordering form I use browser cookies to keep track of user items. My confirmation page reads: "If any of this information is incorrect, please go back to the order form and...
6
by: Dave | last post by:
Hello. I want to prompt user for some action with Yes/No message, I know some tricks in JavaScript, but I need to handle the user answer at server side. Exactly I want to prompt user for...
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
6
by: JenHu | last post by:
Hi experts, I want to add a delete button in my datagrid, and before it deletes from database, I want to have a confirm dialog box for this deletion. I am entry level to the vb.net, and don't...
4
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on...
1
by: Amelyan | last post by:
What is the common way in ASP.NET C# to pop up a confirmation dialog box? E.g. Are you sure you want to delete this item? Yes No
0
by: Elton W | last post by:
Hi Peter, You use DeleteButton.Attributes.Add("onclick", "return confirm ('Are you sure you want to delete?');"); in datagrid_ItemDataBound event to add confirmation for delete button.
5
by: sweetpotatop | last post by:
Hi, I have a page written in C# asp.net, which allow users to select and delete records. Once user selects the record to be deleted, I will confirm with the user, something like "Are you sure...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.