Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

How do I redirect Modal to another page?

See following code. I want to do to another program when the Close button is clicked in the tout Modal. How do I do that?

      function chk_down() {

         if (down == "y") {

            $("#toutModal").modal('show');

         }

      }         

   </script>      

</head>


<body onLoad="chk_dupe(); chk_down();">

<div class="modal fade" id="dupeModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>

                <h4 class="modal-title" id="exampleModalLabel"><b>Please Log In</b></h4>

            </div>

         <!-- change to 10 & 10 for live -->

            <div class="modal-body">

                <p>You are already registered. Please log in.</p>

            </div>

            <div class="modal-footer">

                <button type="button" onclick="logout();" class="btn btn-secondary" data-dismiss="modal">Close</button>

            </div>

        </div>

    </div>

</div>

<!-- Modal's -->

<div class="modal fade" id="toutModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">&times;</button>

                <h4 class="modal-title" id="exampleModalLabel"><b>Notice</b></h4>

            </div>

         <!-- change to 10 & 10 for live -->

            <div class="modal-body">

                <p>Backflowtestreport.com is down for scheduled maintenance. It will be back up before 8 AM, Monday April 3, Central Time.</p>

            </div>

            <div class="modal-footer">

                <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>

            </div>

        </div>

    </div>

</div>

Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

..I want to do to another program when the Close button is clicked in the tout Modal. How do I do that?

In this case, you can use location.href to navigate to your new page instead open the modal dialog.


Example:

function chk_down() {


         if (down == "y") {
      //$("#toutModal").modal('show');

location.href="https://www.google.com";
         }


      }         

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial