Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jun 2006
    Thanked 0 Times in 0 Posts

    Retrieving value from javascript prompt box

    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.

    Last edited by xbabigyrlx; 12-13-2006 at 05:48 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts