Recently I was trying to create a hidden field on a form I’ve been working with and couldn’t find anything in the Drupal documentation that explained how to create a hidden form. The solution is actually quite simple.
In this case I was using the hidden field to store a primary key value.
$form[‘form_group’][‘form_name’] = array(
‘#title’ => t(‘ID’),
‘#value’ => $value,
‘#type’ => ‘hidden,
);
It’s as simple as setting the type to hidden.
The Latest
-
Tableau Relationships: Basics – The Ground Rules
04 August, 2022 -
InterWorks Keeping an Eye Out at Eyeo Festival
02 August, 2022 -
DataWomen Event Recap: Everyday AI
02 August, 2022