I followed the instructions at https://github.com/silverstripe/silverstripe-multiform
In my registration page i got:
public function member_reg (){
return array();
}
//freelancer registration form
function MemRegForm(){
$form = new MemRegForm($this, 'MemRegForm');
$form->setDisplayLink('/member/MemRegForm');
return $form;
}
In CMS, i created the page with URLSegment 'member'
The form and 2 steps
class MemRegForm extends MultiForm {
public static $start_step = 'FlRegFormStep1';
public function finish($data, $form) {
parent::finish($data, $form);
}
}
class FlRegFormStep1 extends MultiFormStep {
public static $next_steps = 'FlRegFormStep2';
var $title='Personal Information';
function getFields() {
return new FieldList(
new TextField('FirstName', 'First name'),
new TextField('Surname', 'Surname')
);
}
}
class FlRegFormStep2 extends MultiFormStep {
var $title='Professional Information';
public static $is_final_step = true;
function getFields() {
return new FieldList(
new TextField('FirstName2', 'First name'),
new TextField('Surname2', 'Surname')
);
}
}
however, while i am at step 1, click the 'Next' button to submit the form, i got 'redirect loop' error. could anyone shed some light on this?