You are here

function poll_more_choices_submit in Drupal 6

Same name and namespace in other branches
  1. 7 modules/poll/poll.module \poll_more_choices_submit()

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 modules/poll/poll.module
Implementation of hook_form().

File

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;
  }
}