I want to check the min width of a picture when using the file upload form (file_entity_add_upload).

normally I would do

function my_module_form_file_entity_add_upload_alter(&$form, &$form_state, $form_id) {

  // Adds a description to the upload field.
  $form['file']['#description'] = t('Min width @limit pixels', array('@limit' => 768));

  // Specific validations.
    $form['#validate'][] = 'budg_eu_project_file_entity_add_upload_validate';

but that doesn't work.

How should I declare the description and the validator?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.