7

I want the user defined webform to be popped up in an overlay when a button is clicked. I am using colorbox and colorbox-node modules. I am able to display the whole node. But I am not understanding how to display just the webform instead of the whole node. I used the following code:

 <a class="colorbox-load" href="enquiry?width=600&amp;height=600&amp;iframe=true"><input value="Send Enquiry" type="submit"> </a>
  • Do you mean Webform module? If not, please try avoid the word, as it has pretty specific meaning in Drupal. And remove the tag. Either way, please tell us exactly how have you created your form, as it defines what can be done with it. – Mołot Dec 27 '13 at 7:45
5

If I need to display webform in popup, then I would use ctools modal.

You can use modal forms module which make use of the modal feature in the ctools module to open some common forms in a modal window.

Supported forms

  • Log in (modal_forms/nojs/login)
  • Request new password (modal_forms/nojs/password)
  • Create new account (modal_forms/nojs/register)
  • Contact (modal_forms/nojs/contact)
  • Comment (modal_forms/nojs/comment/reply/%node)
  • Webform (modal_forms/nojs/webform/%node)

May be this is not answer to your question as you are using colorbox, but I am adding this so that you can check other option.

|improve this answer|||||
4
  1. you can enable webforms as a block --> select the webform content you created, tab "Webform" > "Form Settings" > "Enable as a block"

  2. put the block inside a region, I've put mine in the footer region

  3. CSS style the footer webform block as "display: none;"

  4. for colorbox: in "configuration", "Media", "Colorbox" --> advanced settings, activate "Enable Colorbox inline"

  5. add this as the html code for opening the colorbox webform link:

<a class="colorbox-inline" href="?width=310&amp;height=460&amp;inline=true#name-of-your-block">

You can also display the webform in popup using Colorbox Node module.

Gives the user the ability to display ANY page inside a colorbox modal without the header and footer. Those pages include:

  • Node Pages
  • User Pages
  • Views Pages
  • Webforms (requires Webform Ajax Module)
  • Integration with Views
  • Integration with Context
  • Integration with Panels
|improve this answer|||||
  • anjaan has used colorbox-node as a tag so he might be already using it. – arpitr Dec 26 '13 at 13:07
  • i have already tried both the things but no success – Aditya Agarwal Dec 26 '13 at 16:57
  • the problem is that i can open the whole node but not the particular webform. – Aditya Agarwal Dec 26 '13 at 17:11
  • In the colorbox module page I read that "Form support in Colorbox is removed in 7.x-2.x" and we should use Modal Forms as suggested by Jayendra – AgA Dec 27 '13 at 5:55
0

Check out these link how to display webform in overlay

Allow webforms to open in Colorbox

display a popup box containing webform using simple dialog module

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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