Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mytheme_form_alter(&$form, DrupalCoreFormFormStateInterface $form_state, $form_id) {
- // do some checks here, form id, user role, and any other check you'd like
- // and if true or false hide fields
- $form['field_name']['#access'] = FALSE;
- $form['field_name']['#required'] = FALSE;
- }
Add Comment
Please, Sign In to add comment