I'm using %server[HTTP_REFERER] to try and attempt to get the referring page into the form (for a simple "Contact our Editor" type thing), but am finding that it will only capture Drupal pages that way; in this scenario, I'd like it to capture any referring page into the form. Any thoughts on why this isn't working as expected, or would there be another way to accomplish this using the Advanced Options on the Webform?

Comments

phillipadsmith’s picture

Status: Active » Closed (fixed)

Sorry, had a typo in there. Works a-ok. :-)

phillipadsmith’s picture

Status: Closed (fixed) » Active

Actually, upon further investigation, I am having an issue here. Basically, here's what I've done:

* I've created a textfield for the referring page and have selected the disabled option
* In that field, I've put (as suggested) the %server[HTTP_REFERER] to get the referring page

So, when the user arrives at the form, the referring page is pre-populated and is not editable. This all works great.

The problem arrises when the form is submitted. The data that is submitted shows the actual form as the referrer vs. the referring page. Though this may (for some reason?) be technically correct, I don't think it makes sense given that the field is disabled, e.g., if the user can't adjust the value, why should the form be able to?

Phillip.

gvdvenis’s picture

I Agree, on submission the parameter should not be processed again, but instead use the generated value out of the textfield.
This problem also occurs when using a hidden field for this. However, when you set the textfield to enabled, it does work!

phillipadsmith’s picture

Crazy -- I'll give that a try as a stop-gap measure. Hopefully this is a bug worth fixing! :-)

quicksketch’s picture

Status: Active » Closed (fixed)
ar4’s picture

Version: 5.x-1.4 » 5.x-1.8
Status: Closed (fixed) » Postponed (maintainer needs more info)

so, in what version of Webform this bug is fixed?
in 1.8 %server[HTTP_REFERER] still shows actual form

dries arnolds’s picture

Version: 5.x-1.8 » 6.x-2.2

I'm still having this issue in 6.x-2.2, so I updated the version accordingly.

I'd really like to be able to get this to work. I tested it with hidden and disabled fields, but both name the 'thank you'-page as the referrer.

dries arnolds’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

I'm sorry for bumping this up. After some more searching I read this has to do with caching issues and is indeed not a bug.