Results 1 to 3 of 3

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

  1. #1
    Join Date
    Jul 2012

    How to jump to self page based on confirmation box answer

    down vote
    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:
    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
    //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
    HTML Code:
    var result = confirm("Are you super dupper sure about this?");
    if(result == true)
    	document.location.href = "http://www.google.com";
    	document.location.href = "http://www.bing.com";

  3. #3
    Join Date
    Jul 2012
    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