I have a form (webform) in a lightbox. I created a link:

<a class="lightbox-processed" rel="lightframe" href="?q=node/29/lightbox2">show Form</a>

and change 'page--node--lightbox2.tpl.php' (tpl from lightbox2 module) for this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
<body id="lightboxnode-<?php print $node->type ?>">

<?php //dsm($node); ?>

<?php if ($title): ?>
<h1 class="title"><?php print $title; ?></h1>
<?php endif; ?>
    $nodo = $node->nid;
    print render(node_view(node_load($nodo), 'full', NULL));

How can I do for when I click submit, send the form and close the lightbox?


1 Answer 1


I would use jQuery to detect the button click on the submit button and then force the action of closing the lightbox with parent.Lightbox.end();.

The reason I would use jQuery to attach to the event is that you don't have to alter the webform in any way, and can do this passively.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.