function user_badges_change_form_validate in User Badges 7.2
Same name and namespace in other branches
- 6.2 user_badges.module \user_badges_change_form_validate()
- 6 user_badges.module \user_badges_change_form_validate()
- 7.4 user_badges.module \user_badges_change_form_validate()
- 7 user_badges.module \user_badges_change_form_validate()
- 7.3 user_badges.module \user_badges_change_form_validate()
Validate user_badges_remove_form form submissions.
File
- ./
user_badges.module, line 687 - @brief User Badges module file
Code
function user_badges_change_form_validate($form, &$form_state) {
for ($i = 1; $i <= 5; $i++) {
if (!empty($form_state['values']['add' . $i])) {
$validation = user_badges_badge_autocomplete_validation($form_state['values']['add' . $i]);
switch ($validation[1]) {
case 'nobid':
form_set_error('add' . $i, t('@value is not a valid badge ID. Try using the autocomplete function (requires javascript).', array(
'@value' => $validation[0],
)));
break;
case 'string':
form_set_error('add' . $i, t('"@value" is not a valid badge. Try using the autocomplete function (requires javascript).', array(
'@value' => $form_state['values']['add' . $i],
)));
break;
}
}
}
}