View Full Version : Retrieving value from javascript prompt box

12-13-2006, 05:20 PM
I can't figure out how to retreive the prompt box variable from javascript. What I am trying to do is display a confirm box when the user clicks to delete a record. If they agree to "delete" a prompt box is displayed to allow them to enter a reason for "deleting" the record. If they click ok on the prompt box the form is then submitted to an action page that does the updating to the database.

My problem: How do I send to or retrieve that variable from the action page?

Here is my javascript (which works how I want it to except for being able to get the value of "Reason" from the next page)

function confirm_Delete()
input_box = confirm("Are you sure you want to delete this record?");
if(input_box == true)
var Reason = prompt("Reason for deleting:", "")
var Operation = document.deleteform.Operation.value
I tried to add:
setCookie("Comment", Reason); after the prompt to store the value and retreive it from the next page but if I do that my form doesn't submit.

Any help or suggestions would be greatly appreciated. :)