I'd like to open a webform in a colorbox. Yes, I know there are other methods, but we already use colorbox for many things on this particular site.

I understand the normal way to open a webform for a webform that doesn't take any parameters. However, I'd like to pass a parameter or two to the webform per this: http://drupal.org/node/881226

My question, as you can see from the title, is will additional parameters in my link URL which aren't used by colorbox pass through to the webform module? Does the colorbox module simply parse the arguments list for what it needs and leave the whole thing untouched?

For example: Link text

Thanks.

Comments

rconstantine’s picture

doh! i forgot to wrap the link

<a class="colorbox-load" href="http://drupal.org/node/[nid]?width=500&height=250&my-param=value">Link text</a>
D2ev’s picture

Use yourmodule_form_alter to get the argument list like $_REQUEST['my-param'] and can alter the webform accordingly

rconstantine’s picture

Status: Active » Fixed

ok thanks. i must have worked something else out, but this is a good solution too.

wjaspers’s picture

How are you getting Webform to display in a colorbox?
I've tried everything (http://drupal.org/node/940220) I either wind up with: the entire webform node in the colorbox, or a "Forbidden" error.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

D2ev’s picture

to show webform you can use

<a class="colorbox-load" href="/colorbox/form/[webform_id]?argument=[argument_name]&width=800">open webform</a>

Use yourmodule_form_alter to get the argument list like $_REQUEST['argument'] and can alter the webform accordingly

enkara’s picture

Is this possible for D7? I can't get it to work

robcarr’s picture

For Drupal 7:

<a class="colorbox-load" href="/colorbox/[alias or url of webform]?custom_parameter=value&width=300&height=400">Open form</a>
SlowCat’s picture

Excuse me, I'm newbie in php, and I don't know what should I do with yourmodule_form_alter function and how to use $_REQUEST['argument']. Can you help me? I didn't understand "yourmodule" also. What should I write instead of it - colorbox or webform or...? I use drupal 7.