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.
By tammyesbur on
Hello.
I want to hide the field "form key" in all of the webform components.
I tried doing it with "hook_form_alter" and with "[#access] = false" but I can't succeed in this.
I also tried to use "hook_webform_component_load".
But in all of those, i can't understand exactly what I need to do to hide the form key field in all of the components in all of the webforms. I can't even hide one component's "form key" field. I don't understand which is the field that i need to modify.
p.s - im using form_builder too.
I'm doing something wrong.
any help will be appreciated.
thanks, alexandra.
Comments
Hi Alexandra,
Hi Alexandra,
Sorry if I misunderstood but, do you want to hide a field from a Webform?
If so, you can implement "hook_form_webform_client_form_NID_alter" function and set #access to FALSE in all of the corresponding fields. For example:
I hope this helps.