function avatar_selection_delete_form_validate in Avatar Selection 5
Same name and namespace in other branches
- 5.2 avatar_selection.module \avatar_selection_delete_form_validate()
- 6 avatar_selection.admin.inc \avatar_selection_delete_form_validate()
- 7 avatar_selection.admin.inc \avatar_selection_delete_form_validate()
Validate the submission.
Check whether: Delete has been chosen AND a checkbox has been selected
File
- ./
avatar_selection.module, line 549
Code
function avatar_selection_delete_form_validate($form_id, $form_values) {
if ($form_values['op'] == t('Delete')) {
if (count(array_filter($form_values['images'])) == 0) {
form_set_error('images', t('Please select images to delete.'));
}
}
}