function advpoll_form_alter in Advanced Poll 7.3
Same name and namespace in other branches
- 5 advpoll.module \advpoll_form_alter()
- 6.3 advpoll.module \advpoll_form_alter()
- 6 advpoll.module \advpoll_form_alter()
- 6.2 advpoll.module \advpoll_form_alter()
- 7 advpoll.module \advpoll_form_alter()
- 7.2 advpoll.module \advpoll_form_alter()
Implements hook_form_alter().
File
- ./
advpoll.module, line 373
Code
function advpoll_form_alter(&$form, $form_state, $form_id) {
// Add validation to max_choices field.
if ($form_id == 'advpoll_node_form') {
$lang = $form['language']['#value'];
if (!isset($form['advpoll_max_choices'][$lang])) {
$lang = LANGUAGE_NONE;
}
$form['advpoll_max_choices'][$lang][0]['value']['#element_validate'][] = 'advpoll_validate_max_choices';
}
}