You are here

function _webform_required_file in Webform 5

Same name and namespace in other branches
  1. 5.2 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 200

Code

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