Trying to create both a search and user login popup form Ajax-style, similar to the login used on Twitter. Been playing around with some coding and custom stuff, but have yet to successfully do this. Anyone have any ideas?

Chris

Comments

Anonymous’s picture

Drupal comes with jQuery installed, so I suggest using it for this. Something like

$('#loginLink').click( function (e) {
    $('#loginFormDiv').show();
    return FALSE; // Return false to prevent the click from going to the link
});

Then the HTML would be something like this:

<a href='user' id='loginLink'>Login Here</a>

<div id='loginFormDiv' style='display:none;'>
// Put the login form here ... There is a way to generate this from Drupal, but I can't remember it now...
</div>

Hope that helps!

Sincerely,
Leighton Whiting