Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
gemini CreditAttribution: gemini commentedI 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.
Comment #2
quicksketchThis 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.