1

I'm using Webform. Because I wanted to add custom flag for submitted data, so I used this approach with private fields https://drupal.stackexchange.com/a/137847/24385

Is it possible to render such form without private field only on my web? In admin section is everything ok and don't want to change nothing here. Private fields are shown only to users with results access. But what can I do if I want to display the same form for all users. On the web it doesn't matter for me whether user is anonymous and logged in. I need to display form without private fields here. Private fields are important to see only in admin section.

Thanks a lot :)

3
  • I've found that best solution is to use hook_form_alter to remove element from rendering. It can be achieved by this workaround: $form['submitted']['my_field']['#access'] = FALSE; Commented Oct 25, 2015 at 9:06
  • If you resolved your question, please enter your solution in the answer field below so your question can be marked as closed. Commented Oct 26, 2015 at 0:24
  • Good point. Fixed now Commented Oct 26, 2015 at 9:13

1 Answer 1

0

I've found that best solution is to use hook_form_alter to remove element from rendering. It can be achieved by this workaround: $form['submitted']['my_field']['#access'] = FALSE;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.