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; Oct 25 '15 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. Oct 26 '15 at 0:24
  • Good point. Fixed now Oct 26 '15 at 9:13
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, privacy policy and cookie policy

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