I tried to have a hidden field for a second email recipient, but it doesn't work. Only email type fields work. I have alter form on the page to make in hidden.

Comments

gemini’s picture

Title: Hidden fields don't work as conditional email recipients » wrong title
Category: task » bug

I think I see now what's going on.

Here is a quick "what I'm trying to do": I have thousands of business nodes and each of them loads the same webform. I have 2 custom hidden fields in the webform: emailto and referring_url.
- emailto - the email from the business profile which is being pre-set from the business node when the form is rendering. It holds the email value for the conditional email, as so the actual business receives.
- referring_url => http://'.$_SERVER['SERVER_NAME'].request_uri() - the url of the business node where the form was filled out.

Everything works just fine as long as you don't miss any required field. If you miss a required field - it redirects you to the actual webform node where I'm automatically loosing referring_url value. But the most weird part to me is that I still see all the values in the fields, even the hidden ones that were pre-set on the previous page (the business node), but on submit - the value of the hidden emailto is empty. I can see the value entered in the HTML source code... As I said it all works fine if all required fields are entered, but it loses some hidden values after the redirect to the webform node if required fields were missed.

Any ideas on what might be causing this?

Thank you.

quicksketch’s picture

Status: Active » Closed (duplicate)

This is reported in two separate places:

- Validation failing redirects you to the actual webform node: http://drupal.org/node/250767
- $_GET values not working for hidden fields: http://drupal.org/node/241827

It's probably more the first than the second, but I'm pretty sure this is a duplicate. We'll fix the problem in the existing issues.