public function actionsFor($step)
    {
        // Create default multi step actions (next, prev), and merge with extra actions, if any
        $actions = FieldList::create();

        // If the form is at final step, create a submit button to perform final actions
        // The last step doesn't have a next button, so add that action to any step that isn't the final one
        if ($step->isFinalStep()) {
            $actions->push(FormAction::create('finish', $step->getSubmitText()));
        } else {
            $actions->push(FormAction::create('next', $step->getNextText()));
        }

        // If there is a previous step defined, add the back button
        if ($step->getPreviousStep() && $step->canGoBack()) {
            // If there is a next step, insert the action before the next action
            if ($step->getNextStep()) {
                $actions->insertBefore($prev = FormAction::create('prev', $step->getPrevText()), 'action_next');
            // Assume that this is the last step, insert the action before the finish action
            } else {
                $actions->insertBefore($prev = FormAction::create('prev', $step->getPrevText()), 'action_finish');
            }
            //remove browser validation from prev action
            $prev->setAttribute("formnovalidate", "formnovalidate");
        }

        // Merge any extra action fields defined on the step
        $actions->merge($step->getExtraActions());

        return $actions;
    }
public function actionsFor($step)
    {
        // Create default multi step actions (next, prev), and merge with extra actions, if any
        $actions = FieldList::create();

        // If the form is at final step, create a submit button to perform final actions
        // The last step doesn't have a next button, so add that action to any step that isn't the final one
        if ($step->isFinalStep()) {
            $actions->push(FormAction::create('finish', $step->getSubmitText()));
        } else {
            $actions->push(FormAction::create('next', $step->getNextText()));
        }

        // If there is a previous step defined, add the back button
        if ($step->getPreviousStep() && $step->canGoBack()) {
            // If there is a next step, insert the action before the next action
            if ($step->getNextStep()) {
                $actions->insertBefore($prev = FormAction::create('prev', $step->getPrevText()), 'action_next');
            // Assume that this is the last step, insert the action before the finish action
            } else {
                $actions->insertBefore($prev = FormAction::create('prev', $step->getPrevText()), 'action_finish');
            }
            //remove browser validation from prev action
            $prev->setAttribute("formnovalidate", "formnovalidate");
        }

        // Merge any extra action fields defined on the step
        $actions->merge($step->getExtraActions());

        return $actions;
    }
public function actionsFor ( $ step ) { // Create default multi step actions (next, prev), and merge with extra actions, if any $ actions = FieldList :: create ( ) ; // If the form is at final step, create a submit button to perform final actions // The last step doesn't have a next button, so add that action to any step that isn't the final one if ( $ step -> isFinalStep ( ) ) { $ actions -> push ( FormAction :: create ( 'finish' , $ step -> getSubmitText ( ) ) ) ; } else { $ actions -> push ( FormAction :: create ( 'next' , $ step -> getNextText ( ) ) ) ; } // If there is a previous step defined, add the back button if ( $ step -> getPreviousStep ( ) && $ step -> canGoBack ( ) ) { // If there is a next step, insert the action before the next action if ( $ step -> getNextStep ( ) ) { $ actions -> insertBefore ( $ prev = FormAction :: create ( 'prev' , $ step -> getPrevText ( ) ) , 'action_next' ) ; // Assume that this is the last step, insert the action before the finish action } else { $ actions -> insertBefore ( $ prev = FormAction :: create ( 'prev' , $ step -> getPrevText ( ) ) , 'action_finish' ) ; } //remove browser validation from prev action $ prev -> setAttribute ( "formnovalidate" , "formnovalidate" ) ; } // Merge any extra action fields defined on the step $ actions -> merge ( $ step -> getExtraActions ( ) ) ; return $ actions ; }
Build a FieldList of the FormAction fields for the given step.

If the current step is the final step, we push in a submit button, which
calls the action {@link finish()} to finalise the submission. Otherwise,
we push in a next button which calls the action {@link next()} to determine
where to go next in our step process, and save any form data collected.

If there's a previous step (a step that has the current step as it's next
step class), then we allow a previous button, which calls the previous action
to determine which step to go back to.

If there are any extra actions defined in MultiFormStep->getExtraActions()
then that set of actions is appended to the end of the actions FieldSet we
have created in this method.

@param MultiFormStep $step Subclass of MultiFormStep
@return FieldList of FormAction objects
Build a FieldList of the FormAction fields for the given step .