From c08e2798594f2643de5469a9763cc7ad323bf0c8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Tue, 15 Jan 2008 07:57:46 +0000 Subject: [PATCH] - Patch #209236 by traxer: added a validation function for the poll form. --- modules/poll/poll.module | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/poll/poll.module b/modules/poll/poll.module index cd56777cf982..155b3c7ad65b 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -585,6 +585,15 @@ function poll_view_voting(&$form_state, $node, $block) { 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 */ -- GitLab