Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Delete Confirmation

 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is completely a client-side operation, I'm moving this to the HTML/Javascript forum.
bear
 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont know how to display the dialog box and than set condns...pls reply
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rose hegde
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My delete link is not a button but i am using as href...
so how to go abt it?
 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic