Skip to main content
Participating Frequently
February 4, 2017
Answered

Embedding a script into image map

  • February 4, 2017
  • 1 reply
  • 258 views

Hi.  I am trying to replace one of the url links in the image map on this page...  www.kicksandsnares.com, with a script.

When someone clicks on that part of the image, I'd like an email sign up form to pop up.

Is this possible?

Sorry if this is a simple question, I just can't seem to figure it out.  & if it isn't obvious I don't really know much about Dreamweaver. 

The code is below...

<script src="//static.leadpages.net/leadboxes/current/embed.js" async defer></script> <a href="" data-leadbox-popup="14657b173f72a2:112623a17346dc">Click here to subscribe</a>

    This topic has been closed for replies.
    Correct answer Nancy OShea

    I think what you want is a <form> to appear inside a modal window.

    This is a bit advanced.  How good are your coding skills?

    As far as the Modal Window goes, you can use a jQuery UI Dialog for that.  The code follows below.  Copy & paste this into a new blank document.  Save as test.html and preview in a browser.

    <!doctype html>

    <html lang="en">

    <head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>jQuery UI Dialog + Animation</title>

    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

    </head>

    <body>

    <button id="opener">Click to Join Email List</button>

    <div id="dialog" title="Email Form">

    <form action="your-form-to-email-script.php">

    <p>

    <label for="name">Name:</label>

    <input type="name" id="name" required placeholder="First & Last">

    </p>

    <p>

    <label for="email">Email</label>

    <input type="email" id="email" required placeholder="yourname@domain.com">

    <br>

    </p>

    <input type="submit" value="Submit">

    </form>

    </div>

    <!--jquery code library-->

    <script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous"></script>

    <!--jQuery UI library-->

    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

    <!--invoke dialog function on page load-->

    <script>

      $( function() {

        $( "#dialog" ).dialog({

          autoOpen: false,

          show: {

            effect: "blind",

            duration: 1000

          },

          hide: {

            effect: "explode",

            duration: 1000

          }

        });

        $( "#opener" ).on( "click", function() {

          $( "#dialog" ).dialog( "open" );

        });

      } );

      </script>

    </body>

    </html>

    It goes without saying, you'll need to provide your own form processing script in a server-side language that's supported by your web hosting plan.

    Nancy

    1 reply

    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    February 4, 2017

    I think what you want is a <form> to appear inside a modal window.

    This is a bit advanced.  How good are your coding skills?

    As far as the Modal Window goes, you can use a jQuery UI Dialog for that.  The code follows below.  Copy & paste this into a new blank document.  Save as test.html and preview in a browser.

    <!doctype html>

    <html lang="en">

    <head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>jQuery UI Dialog + Animation</title>

    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">

    </head>

    <body>

    <button id="opener">Click to Join Email List</button>

    <div id="dialog" title="Email Form">

    <form action="your-form-to-email-script.php">

    <p>

    <label for="name">Name:</label>

    <input type="name" id="name" required placeholder="First & Last">

    </p>

    <p>

    <label for="email">Email</label>

    <input type="email" id="email" required placeholder="yourname@domain.com">

    <br>

    </p>

    <input type="submit" value="Submit">

    </form>

    </div>

    <!--jquery code library-->

    <script src="https://code.jquery.com/jquery-1.12.2.min.js" integrity="sha256-lZFHibXzMHo3GGeehn1hudTAP3Sc0uKXBXAzHX1sjtk=" crossorigin="anonymous"></script>

    <!--jQuery UI library-->

    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

    <!--invoke dialog function on page load-->

    <script>

      $( function() {

        $( "#dialog" ).dialog({

          autoOpen: false,

          show: {

            effect: "blind",

            duration: 1000

          },

          hide: {

            effect: "explode",

            duration: 1000

          }

        });

        $( "#opener" ).on( "click", function() {

          $( "#dialog" ).dialog( "open" );

        });

      } );

      </script>

    </body>

    </html>

    It goes without saying, you'll need to provide your own form processing script in a server-side language that's supported by your web hosting plan.

    Nancy

    Nancy O'Shea— Product User & Community Expert