function _webform_edit_hidden in Webform 5
Same name and namespace in other branches
- 5.2 components/hidden.inc \_webform_edit_hidden()
- 6.3 components/hidden.inc \_webform_edit_hidden()
- 6.2 components/hidden.inc \_webform_edit_hidden()
- 7.4 components/hidden.inc \_webform_edit_hidden()
- 7.3 components/hidden.inc \_webform_edit_hidden()
Create a set of form items to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every component type and are not necessary to specify here (although they may be overridden if desired).
Return value
An array of form items to be displayed on the edit component page.
File
- components/
hidden.inc, line 11
Code
function _webform_edit_hidden($currfield) {
$edit_fields = array();
$edit_fields['value'] = array(
'#type' => 'textfield',
'#title' => t("Default value"),
'#default_value' => $currfield['default'],
'#description' => t('The default value of the field.') . '<br />' . webform_help('webform/helptext#variables'),
'#size' => 60,
'#maxlength' => 127,
'#weight' => 0,
);
$edit_fields['mandatory'] = array(
'#type' => 'hidden',
'#value' => 1,
);
$edit_fields['extra']['description'] = array();
// Hide the description box.
return $edit_fields;
}