Display thank you page after user submits form

Permalink
I am looking to create a "thank you" page after users submit a form rather than simply displaying an empty form. How can I do this? Thanks

rdains
View Replies:
kino replied on at Permalink Reply
kino
Is very good timing.
There was a request just created.


make
/blocks/form/

copy
/concrete/blocks/form/controller.php
to
/blocks/form/controller.php

change at line 330
//$_REQUEST=array();   
if(!$this->noSubmitFormRedirect){
   header("Location: ".$refer_uri."&surveySuccess=1&qsid=".$this->questionSetId);
   die;
}


to

//$_REQUEST=array();
if(!$this->noSubmitFormRedirect){
   if(substr($this->thankyouMsg,0,4)=='http'){
           header("Location: ". $this->thankyouMsg );
           die;
   } else {
      header("Location: ".$refer_uri."&surveySuccess=1&qsid=".$this->questionSetId);
      die;
   }
}


make thankyou page and setting url to
[Message to display when completed:] field.
kino replied on at Permalink Reply
kino
To proceed, other advice.

copy
/concrete/mail/block_form_submission.php

to
/mail/block_form_submission.php

change
foreach($questionAnswerPairs as $questionAnswerPair){
   $submittedData .= $questionAnswerPair['question']."\r\n".$questionAnswerPair['answer']."\r\n"."\r\n";
}


to

foreach($questionAnswerPairs as $questionAnswerPair){
   $submittedData .= $questionAnswerPair['question']."\r\n".$questionAnswerPair['answer']."\r\n"."\r\n";
   if($questionAnswerPair['question']=='e-mail'){
      $email = $questionAnswerPair['answer'];
   }
   if($questionAnswerPair['question']=='name'){
      $name = $questionAnswerPair['answer'];
   }
if(isset($email)){
   $from[0] = $email;
   $from[1] = $name;
}


you set [Notify me by email when people submit this form: ].

Reply to e-mail can be received.
kino replied on at Permalink Reply
kino
These customize created at the request ofhttp://www.dream-market.jp/ .
http://interdic.co.jp/ is the final customer.

Has published at no charge to the customer's approval has been obtained for value creation.
vGibson replied on at Permalink Reply
vGibson
This seems to break the process in 5.4.1 and just goes to a blank white page on submission.
rdains replied on at Permalink Reply
rdains
Kino, thanks for this code. I followed the instructions, but what do you mean by "make thank you page and setting url?" Thanks.
Tony replied on at Permalink Reply
Tony
a quick and dirty way of doing this is to add something like this to the thank you message field:

Thanks! <script>window.location="/form_thankyou_page/"</script>


but a few people have requested this ability, so it really should be added to the form block at some point.