wzrd
09-21-2004, 06:26 PM
I didn't know whether to put this here or the Javascript forum
I have an ASP page that loads up, reads in Form variables from the previous page and deletes records in an SQL database based upon those variables.
The trick being, I want to be able to prompt the user, "Are you sure?". I tried doing this with an
var stay=confirm("Are you sure you wish to delete these records? If you say yes, you will not be able to undo these actions.")
if (!stay)
window.location="recordData.asp"
and having the ASP code that actually deleted the records, after that on the page. Of course, the problem being that the ASP code runs before anything else so by the time they click Ok/Cancel, it's already been done.
So, I'm wondering, how do I go about this? Do I need to have a page in between the Form page and the actual deletion page? Is there not something simplier? I come from Thick client programming most recently so have to have a whole other page seems much overkill and much extra work.
Thanks for any help you can offer.
I have an ASP page that loads up, reads in Form variables from the previous page and deletes records in an SQL database based upon those variables.
The trick being, I want to be able to prompt the user, "Are you sure?". I tried doing this with an
var stay=confirm("Are you sure you wish to delete these records? If you say yes, you will not be able to undo these actions.")
if (!stay)
window.location="recordData.asp"
and having the ASP code that actually deleted the records, after that on the page. Of course, the problem being that the ASP code runs before anything else so by the time they click Ok/Cancel, it's already been done.
So, I'm wondering, how do I go about this? Do I need to have a page in between the Form page and the actual deletion page? Is there not something simplier? I come from Thick client programming most recently so have to have a whole other page seems much overkill and much extra work.
Thanks for any help you can offer.