Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8468587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:58:36+00:00 2026-06-10T15:58:36+00:00

I need to pop-up a modal dialog with a warning, wait for the warning

  • 0

I need to pop-up a modal dialog with a warning, wait for the warning to be acknowledged and then forward to a constructed url. My current attempt shows the dialog in the window and immediately forwards.

I need each link (button in the example) to be able to pass a parameter to the final url, thus the need to do it in an onclick. The html will be generated from a jsp.

See following for a demo:

<html>
  <head></head>
  <body>
    <div id='container'>
      <input type='button' name='StackOverflow' value='StackOverflow' onClick="Google('StackOverflow')" />
      <br />
      <br />
      <input type='button' name='CodingHorror' value='CodingHorror' onClick="Google('CodingHorror')" />
      <br />
      <br />
    </div>
    <div id="dialog" style="display: none">
      <em>Going to Google</em>
      <hr />
      <ul>
        <li>No guarantee is made that this will work.</li>
        <li>We take no responsibility for the consequences of this action.</li>
      </ul>
    </div>
    <script type='text/javascript' src='js/jquery.js'></script>
    <script type='text/javascript' src='js/jquery.simplemodal.js'></script>
    <script>
    function Google(s) { 
        // Replace this.
        //alert("Going to: "+s); 
        // What to do here to popup a formatted dialog in place of the alert, wait for it to be acknowledged and then proceed with the forward.
        // Doesn't work.
        jQuery("#dialog").modal(); 
        window.location='http://www.google.co.uk?as_q='+s; 
    }
    </script>
  </body>
</html>

You will need jQuery and simplemodal.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:58:38+00:00Added an answer on June 10, 2026 at 3:58 pm

    Cracked it!! You have to do the forwarding through the onClose.

    Note that I am setting the class of my dialog div to simplemodal-close so clicking anywhere in it is considered a close. This is because this is a touch-screen driven tool.

    <html>
      <head>
      <style>
        #simplemodal-container {
            background-color:#afafaf; 
            border:solid; 
            padding:12px; 
            cursor:pointer
        }
      </style>
      </head>
      <body>
        <div id='container'>
          <br />
          <br />
          <input type='button' name='StackOverflow' value='StackOverflow' onClick="Google('StackOverflow')" />
          <br />
          <br />
          <input type='button' name='CodingHorror' value='CodingHorror' onClick="Google('CodingHorror')" />
          <br />
          <br />
        </div>
        <div id="dialog" class="simplemodal-close" style="display: none">
          <em>Going to Google</em>
          <hr />
          <ul>
            <li>No guarantee is made that this will work.</li>
            <li>We take no responsibility for the consequences of this action.</li>
          </ul>
        </div>
        <script type='text/javascript' src='js/jquery.js'></script>
        <script type='text/javascript' src='js/jquery.simplemodal.js'></script>
        <script>
        function Google(s) { 
            $.modal($('#dialog'),{
                onClose: function (dialog) {
                    window.location='http://www.google.co.uk?as_q='+s;
                }}
            );
        }
        </script>
      </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need a pop up window which asks me before proceeding to next like
I need to pop up a quick dialog for the user to select one
I'm writing a Python+Qt4 application that would ideally need to pop up a window
I need to have a pop-up dialog like the Color Dialog or Save Dialog
Im trying to make a pop-up like window using jquery and its modal box.
I need to pop up a jquery dialog as confirmation before a submit happens.
I need to create a non modal Silverlight 4.0 control that would appear (pop
I need to dismiss the two modal view controllers, I know how to pop
I would like to create a javascript modal pop up window to get some
I've went to this tutorial to do a modal pop up window, and it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.