Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
avatar_selection_delete_form_validate($form, &$form_state)
contributions/avatar_selection/avatar_selection.module, line 915
Validate the submission.
Check if Delete has been chosen AND a checkbox has been selected.
$form General variable used in drupal, defining the structure & the fields of a form.
&$form_state General reference, used to control the processing of the form.
<?php
function avatar_selection_delete_form_validate($form, &$form_state) {
if ($form_state['values']['op'] == t('Delete')) {
if (count(array_filter($form_state['values']['images'])) == 0) {
form_set_error('images', t('Please select images to delete.'));
}
}
}
?>