<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <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=ISO-8859-1">
      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">&nbsp; $form['guest_email'] = array(<br>
        &nbsp;&nbsp;&nbsp; '#type' =&gt; 'textfield',<br>
        &nbsp;&nbsp;&nbsp; '#default_value' =&gt; t('Email Address'),<br>
        &nbsp;&nbsp;&nbsp; '#size' =&gt; 60,<br>
        &nbsp;&nbsp;&nbsp; '#maxlength' =&gt; 60,<br>
        &nbsp;&nbsp;&nbsp; '#attributes' =&gt; array('class' =&gt; 'defaultText',
        'onClick' =&gt; "SelectAll('edit-guest-email');"),<br>
        &nbsp;&nbsp;&nbsp; '#required' =&gt; TRUE,<br>
        &nbsp; );<br>
        &nbsp;&nbsp;&nbsp; $form['submit'] = array(<br>
        &nbsp;&nbsp;&nbsp; '#type' =&gt; 'submit',<br>
        &nbsp;&nbsp;&nbsp; '#value' =&gt; t('Download'),<br>
        &nbsp;&nbsp;&nbsp; '#ajax' =&gt; array(<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'custom_login',<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wrapper' =&gt; 'inner',<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'method' =&gt; 'replace',<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'effect' =&gt; 'fade',<br>
        &nbsp;&nbsp;&nbsp; ),<br>
        &nbsp; );<br>
        &nbsp; return $form;<br>
        }<br>
        <br>
        Thanks.<br>
        <br>
        <div class="moz-signature">-- <br>
          <meta http-equiv="content-type" content="text/html;
            charset=ISO-8859-1">
          <title></title>
          -Don Pickerel-<br>
          Fane Software<br>
          <img alt="" src="cid:part1.03090402.05050108@fane.com"
            height="70" width="66"><br>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <br>
      <div class="moz-signature">-- <br>
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-1">
        <title></title>
        -Don Pickerel-<br>
        Fane Software<br>
        <img alt="" src="cid:part2.02010102.03080800@fane.com"
          height="70" width="66"><br>
      </div>
    </div>
  </body>
</html>