473,769 Members | 5,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?whic h=345 %>" onclick="javasc ript: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 3096
On Thu, 04 Aug 2005 04:53:07 GMT, le*****@anti-spam.iafrica.co m (Les
Juby) wrote:
onclick="javasc ript: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.co m 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?whic h=345 %>" onclick="javasc ript: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="retur n confirm('Are you
ABSOLUTELY SURE you want to DELETE this record ?');">

OR

<input type="submit" value="Delete"o nclick="javascr ipt: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
6976
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 box to make sure the user wants to delet the file. Here is my code: private string GetFilesFromAccessDb() {
3
1979
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 change it. We thank you for your patronage.". Question. At what point will I be able to delete my cookies? If I delete them before posting the online form, then they won't be available if customers from the confirmation page.
6
3417
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 confirmation on delete action of some data in my application. How can I do this?
3
2794
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, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts: I am working in the Microsoft Development Environment 2003 (Version
6
4638
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 know java or c#. The problem is, when I tested the program, there is no pop-up confirmation box for the deletion, can you show me what' wrong with this code? Thank you.
4
3032
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 that page. Each row in each datagrid includes a Delete button (added at runtime by the code-behind page as a ButtonColumn) and an Edit button (added at runtime by the code-behind page as an EditCommandColumn). What is the quickest, easiest and...
1
13461
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
2688
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
1589
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 you want to delete the selected records?" If yes, I will go and delete the record from SQL. How can this
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.