function poll_more_choices_submit
7.x poll.module | poll_more_choices_submit($form, &$form_state) |
6.x poll.module | poll_more_choices_submit($form, &$form_state) |
Submit handler to add more choices to a poll form. This handler is used when javascript is not available. It makes changes to the form state and the entire form is rebuilt during the page reload.
1 string reference to 'poll_more_choices_submit'
- poll_form in drupal-6.x/
modules/ poll/ poll.module - Implementation of hook_form().
File
- drupal-6.x/
modules/ poll/ poll.module, line 282 - Enables your site to capture votes on different topics in the form of multiple choice questions.
Code
function poll_more_choices_submit($form, &$form_state) {
// Set the form to rebuild and run submit handlers.
node_form_submit_build_node($form, $form_state);
// Make the changes we want to the form state.
if ($form_state['values']['poll_more']) {
$n = $_GET['q'] == 'poll/js' ? 1 : 5;
$form_state['choice_count'] = count($form_state['values']['choice']) + $n;
}
}