473,890 Members | 1,759 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 1522
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
1421
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
20030
by: Nollie | last post by:
Say you have a struct: struct MYSTRUCT { int x; int y; int w; int h; };
4
4679
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
3385
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
2261
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
3483
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
7214
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
1319
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
9815
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
11215
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...
1
10908
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
10451
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...
0
9618
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7160
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();...
0
6035
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4259
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3267
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.