S
S
Sergey Khlopov2017-11-30 13:27:41
Drupal
Sergey Khlopov, 2017-11-30 13:27:41

How to hide a field in a webform?

Hello, tell me please. How can I hide a form in webform in drupal. The fact is that I am themeing a webform file - "webform-form-7.tpl.php", and there are fields that automatically get values, and they need to be hidden. Tried hiding with $form['submitted']['_hour']['#access'] = FALSE; the field is hidden, but as if this field was empty when submitting and in the results of the webform, there is no value for this field. Then I just tried not to display the field in "webform-form-7.tpl.php", but there is another problem, it then appears near the button, since the button is displayed like this submit <?php print drupal_render_children($form);?>. Please tell me how can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
afi13, 2017-11-30
@Shlop

Try changing the field type to hidden: Or use the hide() function on this element in the template, then it will not be rendered in drupal_render_children() https://api.drupal.org/api/drupal/includes%21commo...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question