- Patch #209236 by traxer: added a validation function for the poll form.
parent
5a54bbe702
commit
c08e279859
|
@ -585,6 +585,15 @@ function poll_view_voting(&$form_state, $node, $block) {
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validation function for processing votes
|
||||||
|
*/
|
||||||
|
function poll_view_voting_validate($form, &$form_state) {
|
||||||
|
if ($form_state['values']['choice'] == -1) {
|
||||||
|
form_set_error( 'choice', t('Your vote could not be recorded because you did not select any of the choices.'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submit handler for processing a vote
|
* Submit handler for processing a vote
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue