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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

multiform - redirect loop


Go to End


975 Views

Avatar
BenWu

Community Member, 97 Posts

18 September 2012 at 1:21am

Edited: 18/09/2012 4:21am

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?