<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Why not just use the Modal forms
      module?<br>
      <br>
      <a class="moz-txt-link-freetext" href="https://www.drupal.org/project/modal_forms">https://www.drupal.org/project/modal_forms</a><br>
      <pre class="moz-signature" cols="72">Jamie Holly
<a class="moz-txt-link-freetext" href="http://hollyit.net">http://hollyit.net</a></pre>
      On 9/17/2014 1:55 AM, Don wrote:<br>
    </div>
    <blockquote cite="mid:5419226A.7060808@fane.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Follow-up question. It turned out the
        popup module loading the form via ajax meant that the event
        handler for the submit button was never registered.<br>
        Does anyone know if there's a way to add the click event when a
        form is loaded well after DOM load?<br>
        <br>
        Thanks.<br>
        -Don-<br>
        <br>
      </div>
      <blockquote cite="mid:5418DE66.8080204@fane.com" type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=windows-1252">
        hi,<br>
        I'm trying to do a little pop-up form linked to a download
        button to have a visitor register before downloading a document.<br>
        This is part of a D7 upgrade of the site, and i was using the
        popups module before.<br>
        <br>
        Now I'm using the popup module, which works fine. But i can't
        get the submit handler to work via ajax. I know it's supposed to
        be really easy and in core now, but i'm wondering what i'm
        missing. I get a full post and page refresh every time i hit the
        button.<br>
        <br>
        Here's what i've got on the login form. I show both forms,
        though they're actually separate. I'm guessing i'm just sleepy
        enough i'm missing something simple.<br>
        <br>
        The form validate just looks up the email in a table and sees if
        they're already registered. If they are, the link to the pdf is
        added to the download button.<br>
        <br>
        <br>
        function myform(){<br>
        <div class="moz-signature">  $form['guest_email'] = array(<br>
              '#type' =&gt; 'textfield',<br>
              '#default_value' =&gt; t('Email Address'),<br>
              '#size' =&gt; 60,<br>
              '#maxlength' =&gt; 60,<br>
              '#attributes' =&gt; array('class' =&gt; 'defaultText',
          'onClick' =&gt; "SelectAll('edit-guest-email');"),<br>
              '#required' =&gt; TRUE,<br>
            );<br>
              $form['submit'] = array(<br>
              '#type' =&gt; 'submit',<br>
              '#value' =&gt; t('Download'),<br>
              '#ajax' =&gt; array(<br>
                'callback' =&gt; 'custom_login',<br>
                'wrapper' =&gt; 'inner',<br>
                'method' =&gt; 'replace',<br>
                'effect' =&gt; 'fade',<br>
              ),<br>
            );<br>
            return $form;<br>
          }<br>
          <br>
          Thanks.<br>
          <br>
          <div class="moz-signature">-- <br>
            <meta http-equiv="content-type" content="text/html;
              charset=windows-1252">
            <title></title>
            -Don Pickerel-<br>
            Fane Software<br>
            <img alt="" src="cid:part1.01050405.00050908@earthlink.net"
              height="70" width="66"><br>
          </div>
        </div>
      </blockquote>
      <br>
      <br>
      <div class="moz-signature">-- <br>
        <meta http-equiv="content-type" content="text/html;
          charset=windows-1252">
        <br>
        <div class="moz-signature">-- <br>
          <meta http-equiv="content-type" content="text/html;
            charset=windows-1252">
          <title></title>
          -Don Pickerel-<br>
          Fane Software<br>
          <img alt="" src="cid:part2.08020407.07000507@earthlink.net"
            height="70" width="66"><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>