You are here

function filefield_file_upload_validate in FileField 6.2

The 'validate' callback for 'duration_combo' form elements. Called after values are assigned, before form validate and submit are called.

1 string reference to 'filefield_file_upload_validate'
filefield_file_upload_process in ./filefield.widget.inc
The 'process' callback for 'filefield_file_upload' form elements. Called after defining the form and while building it, transforms the barebone element array into a file selection widget.

File

./filefield.widget.inc, line 158
FileField: Defines a CCK file field type.

Code

function filefield_file_upload_validate($element, &$form_state) {
  if (!empty($element['#required']) && empty($element['#value']['fid'])) {
    form_error($element, t('You need to upload a file to the %field field.', array(
      '%field' => $element['#field']['widget']['label'],
    )));
  }
}