Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Multi Step Form: Not progressing to next step


Reply

209 Views

Avatar
Bimble

30 December 2013 at 1:52am Community Member, 16 Posts

Im trying to create a multi step form. The first step works fine, but after pressing next, I get a no content underneath the title.

Anyone familiar with this module can see any code errors?

<?php

class CSVWizard extends Page {
}

class CSVWizard_Controller extends Page_Controller {
private static $allowed_actions = array('index', 'CSVWizard');
public function index(SS_HTTPRequest $request) {
$this->Content = $this->CSVWizardForm();
return $this->render();
}
public function CSVWizardForm() {
return new CSVWizardMultiForm($this, 'CSVWizard');
}
function finished() {
return array(
'Title' => 'Thank you for your submission',
'Content' => "<p>You have successfully submitted the form!</p>"
);
}
}

class CSVWizardMultiForm extends MultiForm {
public static $start_step = 'CSVSelectFile';
}

class CSVSelectFile extends MultiFormStep {
public static $next_steps = 'CSVSelectSchema';
function getFields() {
return new FieldList(
new TextField('directory', 'Directory'),
new TextField('filePattern', 'File Pattern')
);
}
}

class CSVSelectSchema extends MultiFormStep {
public static $next_steps = 'CSVUpdateTask';
function getFields() {
return new FieldList(
new TextField('style', 'Style'),
new TextField('header', 'Header')
);
}
}

class CSVUpdateTask extends MultiFormStep {
public static $is_final_step = true;
}