| Author |
Delete Confirmation
|
rose hegde
Ranch Hand
Joined: Oct 22, 2003
Posts: 40
|
|
I have a jsp form with backend code in java.!! I have a delete option where i delete a record which is happening successfully.!! What i want is that when the user presses the delete option a confirmation box should appear.If user presses ok than only record should be deleted...else if he presses cancel..than nothing should happen..!! Can anyone help?
|
 |
S. Ganapathy
Ranch Hand
Joined: Mar 26, 2003
Posts: 194
|
|
Hi rose hegde, Use javascript confirm method to display confirmation dialog. Like: if (confirm(condition) == true) { subit the request } else { do nothing } Regards, Ganapathy,S
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
Since this is completely a client-side operation, I'm moving this to the HTML/Javascript forum. bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
rose hegde
Ranch Hand
Joined: Oct 22, 2003
Posts: 40
|
|
|
I dont know how to display the dialog box and than set condns...pls reply
|
 |
Jasmine kaur
Ranch Hand
Joined: Nov 25, 2003
Posts: 157
|
|
Hello , Well you can use javascript to do this checking of deleting the records by showing dialog box so you use alert method using the javascript and your problem will be solved .So it would be very easy and fast. Thanks I hope this would work.
|
jasmine kaur
|
 |
rose hegde
Ranch Hand
Joined: Oct 22, 2003
Posts: 40
|
|
My delete link is not a button but i am using as href... so how to go abt it?
|
 |
Jasmine kaur
Ranch Hand
Joined: Nov 25, 2003
Posts: 157
|
|
well your delete is href then you can delete it as the page is aform then through javascript you can delete this link using DOM Concept.As every form page mantain an array of elements of its page and using the DOM cencept you can delete this link using events. I hope it would definitley work. Thanks,
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Ugh, the person wants to see code and not an explaination.... That is what you need to do if you are submitting a form, If you are submitting to a link then you will need to pass it to the function. If you need help doing that I am sure someone here can help since this is the onl time I will be on today since I am in Vegas on vacation. Eric
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
rose, just some (hopefully) helpful advice. If you are going to continue to work on web applications, you are going to have to start writing some code yourself and being able to answer these easier questions on your own. For starters, I recommend "DHTML: The Definitive Reference" by Danny Goodman as a client-side reference. bear
|
 |
 |
|
|
subject: Delete Confirmation
|
|
|