<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"> $form['guest_email'] = array(<br>
'#type' => 'textfield',<br>
'#default_value' => t('Email Address'),<br>
'#size' => 60,<br>
'#maxlength' => 60,<br>
'#attributes' => array('class' => 'defaultText',
'onClick' => "SelectAll('edit-guest-email');"),<br>
'#required' => TRUE,<br>
);<br>
$form['submit'] = array(<br>
'#type' => 'submit',<br>
'#value' => t('Download'),<br>
'#ajax' => array(<br>
'callback' => 'custom_login',<br>
'wrapper' => 'inner',<br>
'method' => 'replace',<br>
'effect' => '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=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>