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

MmMnRr’s picture

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:

function mymodule_form_webform_client_form_7_alter(&$form, &$form_state, $form_id) {
  $form['submitted']['my_first_field']['#access'] = FALSE;
  $form['submitted']['my_second_field']['#access'] = FALSE;
  // (...)
}

I hope this helps.