function _webform_required_file in Webform 6.2
Same name and namespace in other branches
- 5.2 components/file.inc \_webform_required_file()
- 5 components/file.inc \_webform_required_file()
- 6.3 components/file.inc \_webform_required_file()
1 string reference to '_webform_required_file'
- _webform_render_file in components/
file.inc - Build a form item array containing all the properties of this component.
File
- components/
file.inc, line 302 - Webform module file component.
Code
function _webform_required_file($form_element, $form_state) {
$component = $form_element['#webform_component'];
$form_key = $component['form_key'];
if (empty($_FILES['files']['name'][$form_key]) && $component['mandatory']) {
form_set_error($form_key, t('%field field is required.', array(
'%field' => $component['name'],
)));
}
}