diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-01-15 07:57:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-01-15 07:57:46 +0000 |
commit | c08e2798594f2643de5469a9763cc7ad323bf0c8 (patch) | |
tree | bdafb3b79b6e57b60c71035c92506419e461b983 /modules/poll/poll.module | |
parent | 5a54bbe702d09de2252f2f3194e30898537d7244 (diff) | |
download | brdo-c08e2798594f2643de5469a9763cc7ad323bf0c8.tar.gz brdo-c08e2798594f2643de5469a9763cc7ad323bf0c8.tar.bz2 |
- Patch #209236 by traxer: added a validation function for the poll form.
Diffstat (limited to 'modules/poll/poll.module')
-rw-r--r-- | modules/poll/poll.module | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module index cd56777cf..155b3c7ad 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -586,6 +586,15 @@ function poll_view_voting(&$form_state, $node, $block) { } /** + * 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 */ function poll_vote($form, &$form_state) { |