[support] pop-up register or login form

Don donald at fane.com
Wed Sep 17 01:05:42 UTC 2014


hi,
I'm trying to do a little pop-up form linked to a download button to 
have a visitor register before downloading a document.
This is part of a D7 upgrade of the site, and i was using the popups 
module before.

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.

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.

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.


function myform(){
   $form['guest_email'] = array(
     '#type' => 'textfield',
     '#default_value' => t('Email Address'),
     '#size' => 60,
     '#maxlength' => 60,
     '#attributes' => array('class' => 'defaultText', 'onClick' => 
"SelectAll('edit-guest-email');"),
     '#required' => TRUE,
   );
     $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Download'),
     '#ajax' => array(
       'callback' => 'custom_login',
       'wrapper' => 'inner',
       'method' => 'replace',
       'effect' => 'fade',
     ),
   );
   return $form;
}

Thanks.

-- 
-Don Pickerel-
Fane Software

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20140916/a83dcb7c/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fane-th.png
Type: image/png
Size: 18361 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/support/attachments/20140916/a83dcb7c/attachment-0001.png 


More information about the support mailing list