www.webdeveloper.com
Results 1 to 3 of 3

Thread: How to jump to self page based on confirmation box answer

Hybrid View

  1. #1
    Join Date
    Jul 2012
    Posts
    2

    How to jump to self page based on confirmation box answer

    0
    down vote
    favorite
    I want to execute an SQL on my php server based on a user confirmation prompted not by a button but by another sql result. So I tried to do something like this:
    Code:
    if ($result == 1) {
    ?>
    <script type="text/javascript">
    if (confirm=("want to continue?"))
    {
    var vform;
    vform.FORM = JumpForm;  
    vform.VAR.value = 'Y';
    vform.action = "index.php"   //self page
    }
    </script>
    <?php
    }
    //JumpForm defined somewhere here
    But it doesn't bring the control back to the index.php in round trip. Instead it just continues with the following php statements.

    How should I fix it?

  2. #2
    Join Date
    Jul 2012
    Posts
    3
    HTML Code:
    var result = confirm("Are you super dupper sure about this?");
    
    if(result == true)
    {
    	document.location.href = "http://www.google.com";
    }
    else
    {
    	document.location.href = "http://www.bing.com";
    }

  3. #3
    Join Date
    Jul 2012
    Posts
    2
    But I need to send some hidden variables such as password via POST to the page as well, that's why I'm trying to use oForm.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles