You are here

public function ApprovalPollViewForm::addOneWriteIn in Advanced Poll 8

Submit handler for the "add-one-more" button.

Increments the max counter and causes a rebuild.

File

src/Form/ApprovalPollViewForm.php, line 324

Class

ApprovalPollViewForm
Class ApprovalPollViewForm

Namespace

Drupal\advpoll\Form

Code

public function addOneWriteIn(array &$form, FormStateInterface $form_state) {
  $numWriteIn = $form_state
    ->get('num_writein');
  $form_state
    ->set('num_writein', $numWriteIn + 1);
  $form_state
    ->setRebuild();
}