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.
Hi,
%get[key] doesn't work for hidden fields but works for textfields.
thanks,
introfini
Comments
Comment #1
introfini CreditAttribution: introfini commentedbetter yet, it just works for %get[q], not for other variables in the $_GET array like in this example:
node/30110?nid=1000 -> %get[nid]
introfini
Comment #2
quicksketchDuplicate of http://drupal.org/node/223388
Comment #3
quicksketchComment #4
ellen.davis CreditAttribution: ellen.davis commentedI did some digging into the code, and have found a possible fix. In function _webform_render_hidden change '#value' to '#default_value'.
Comment #5
gemini CreditAttribution: gemini commentedI assume this was an advice to edit the function in the module file. That didn't help.
I rendered my hidden filed arrays and pin pointed the actual variables that carry posted values. Then I went to my webform template file and before the drupal_render() function entered the following condition:
This worked for a regular text field, but didn't work for the hidden email field. The values are being entered into the array just fine. Actually for the email I have [value] set and the ['#default_value'] set (just in case) and after than didn't work out, I went after the :
which didn't deliver the desired result either. But as I said, it works with regular text fields.
If someone can help me out to get this temporary workaround for the hidden email field working, I would greatly appreciate it.