21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 789 Views |
-
(solved) Redirect to child page after form submit?

21 March 2011 at 4:31pm Last edited: 21 March 2011 6:51pm
Once I process my form submission I'd like to redirect to a child page of the form.
I'm sure I'm just missing something simple here.
I'm trying this (and many variations of):
function doSignup($data, $form) {
$submission = new LandingFormSubmission();
$form->saveInto($submission);
$submission->write();
Director::redirect($this->Children()->First()->Link());
}EDIT:
This isn't the first time this has happened to me. Shame on me. I forgot that this page was "Not shown in menu" so Children() was empty.
The director should have been:
Director::redirect($this->AllChildren()->First()->Link());Note to anyone else looking at this. If your page is not shown in the menu(Behavior tab), then you have to use AllChildren(), not Children().
Chris.b
-
Re: (solved) Redirect to child page after form submit?

11 November 2011 at 11:03pm
Hey there,
I know this post is quite old, but I was wandering if you could tell me where to insert the code you have mentioned in the post. I have a client who wants a solution similar to what your post talks about.
They want to create a series of forms that when you submit the first one, the information contained is submitted as normal, but then the page is redirected to the next form in the sequence, and so on til the last form. They also want to be able to adjust which is the next form in the sequence using the CMS.
Any help would be much appreciated,
Thanks,
Arun.
| 789 Views | ||
|
Page:
1
|
Go to Top |


