• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Delete Confirmation

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont know how to display the dialog box and than set condns...pls reply
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic