1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

class AreaSelectFormStep extends MultiFormStep {

//  protected static $next_steps = 'PersonalDetailsFormStep';
//  protected static $can_go_back = false;
  protected $title = 'step 1';

  function getFields() {

    $myArea = array(
      1 => 'Connecticut',
      2 => 'New York',
      3 => 'Vermont',
      4 => 'Other'
    );

    $fields = new FieldSet(
      new DropdownField(
        'AreaChoice',
        'Please choose your area:',
        $myArea
      )
    );
    return $fields;

  }

  public function getNextStep() {
    if($this->loadData()->AreaChoice == '4') {
      return 'OtherFormStep';
    }
    else {
      return 'PersonalDetailsFormStep';
    }
  }

}

?>