You are here

function _webform_required_file in Webform 5.2

Same name and namespace in other branches
  1. 5 components/file.inc \_webform_required_file()
  2. 6.3 components/file.inc \_webform_required_file()
  3. 6.2 components/file.inc \_webform_required_file()

File

components/file.inc, line 300
Webform module file component.

Code

function _webform_required_file($form_element, $form_key, $fieldname, $required = FALSE) {
  if (empty($_FILES['files']['name'][$form_key]) && $required) {
    form_set_error($fieldname, t('%field field is required.', array(
      '%field' => $fieldname,
    )));
  }
}