473,811 Members | 3,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Questiion on "Are you sure"

I have a page that has three submit buttons. Depending upon which one
was clicked, I process it differently on the server in php. One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="retur n
validateAction( )" ).
Aug 22 '08 #1
3 1518
sheldonlg wrote on 22 aug 2008 in comp.lang.javas cript:
I have a page that has three submit buttons. Depending upon which one
was clicked, I process it differently on the server in php. One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="retur n
validateAction( )" ).
<input onclick = 'return .......'

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 22 '08 #2
sheldonlg wrote:
I have a page that has three submit buttons. *Depending upon which one
was clicked, I process it differently on the server in php. *One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. *However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="retur n
validateAction( )" ).
<input type="submit" name="action" value="Update">
<input type="submit" name="action" value="Delete"
onClick="if (!confirm('Sure ?')) return false;">

The 'name'-argument can be used to set the value of 'action' in PHP
(Delete or Update).

Hope this helps,

--
Bart
Aug 23 '08 #3
Bart Van der Donck wrote on 23 aug 2008 in comp.lang.javas cript:
sheldonlg wrote:
>I have a page that has three submit buttons. *Depending upon which one
was clicked, I process it differently on the server in php. *One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. *However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="retur n
validateAction ()" ).

<input type="submit" name="action" value="Update">
<input type="submit" name="action" value="Delete"
onClick="if (!confirm('Sure ?')) return false;">
onClick = "return confirm('Sure ?');"
The 'name'-argument can be used to set the value of 'action' in PHP
(Delete or Update).


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 23 '08 #4

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

Similar topics

5
1419
by: Edward K. Ream | last post by:
The docs for 2.2 and 2.3 contain a "What's new" section. Are there any such sections for 2.0 and 2.1? If so, where are they? Thanks. Edward -------------------------------------------------------------------- Edward K. Ream email: edreamleo@charter.net Leo: Literate Editor with Outlines
17
19998
by: Nollie | last post by:
Say you have a struct: struct MYSTRUCT { int x; int y; int w; int h; };
4
4675
by: mike | last post by:
regards: <a href="JavaScript:loadwindow(106,90);" style="font-family:Verdana;">元智Intranet</a> In HTML spec,are "href" and "style" called "attribute"?....@@ Could someone good give me the hand? @@. thank you may god be with you
0
3380
by: katheo via AccessMonster.com | last post by:
Hello, I am using a data access page on a local secure server. As the user changes information, the data updates automatically in the database. But when the user goes to close the page, they get a warning that the data has not been saved (default IExplorer form message). How can I disable this? It scares users and they don't believe me that their changes have already been updated in the database. The exact warning a user gets is: "Are...
10
2257
by: Mikael | last post by:
Hi! I have written a logging class for my project and I want to support the stream syntax, that is I would like to write like this in my code: Log log("MYPREFIX"); log << "This is a message, which is being sent to syslog, value =" << 5;
45
3470
by: Gregory Petrosyan | last post by:
1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: >>> raise NameError Traceback (most recent call last): File "<stdin>", line 1, in ? NameError
6
7210
by: Alex Maghen | last post by:
Let's say I have a web forms button which performs a Delete or something. I'd like a click on the button to pop an "Are you Sure" dialog on the client side and then only execute the button's OnClick operation on the server side if the user had clicked Ok (as opposed to Cancel) on the pop-up dialog. I know I can do this all myself with JavaScript, but I was just wondering if any such functionality is already built-in in ASP.NET 2.0 so that...
2
1271
by: Mr. SweatyFinger | last post by:
how can i get an "are you sure" message before delete? thanks
3
1312
by: =?Utf-8?B?QmFycnkgR2lsYmVydA==?= | last post by:
I would like a particular business object to ask for validation when a property is set to a specific value. In this case, I have a TimeStart property and a TimeEnd property. When creating a new object, the default for these properties is Now. However, saving the data with both values set to now would be highly unusual, so I'd want the class to ask for verification. I think this rule should be maintained by the class and not the UI (a...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
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
10652
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10395
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
10408
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,...
1
7673
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
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4346
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
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.