Re: Re: redirection on submit

Joel Palmius <[email protected]> Tue, 1 Mar 2005 12:58:27 +0100 (CET)
Newsgroups gmane.comp.apache.mod-survey.general
Message-ID <[email protected]>
The problem is, what if you want to send a person to different pages 
depending on answer *after* he has finished the last page of the survey. 
The session is cleared after final submit, and the CONTINUE parameter of 
the SURVEY tag supposes that there is only one page to continue to.

Since the perl snippet solution already works with a minimum of fuzz, I 
don't think I will make any syntax changes. It should be documented and 
put in the distributed examples though.

   // Joel


On Tue, 1 Mar 2005, bugant wrote:

> hi all,
>   I've read all this thread... I don't really understand what's the 
> problem...
>
> allan harold wrote:
>> Joel Palmius <joel.palmius <at> miun.se> writes:
>>>> {|
>>>> if($session->getValue("SUBMITTED_SOMEVAR") eq 1)
>>>> {
>>>> $document->SetOption("CONTINUE","someotherpage.html");
>>>> }
> this seems to be something that you can do with an IFROUTE tag. isn't it?
>> In Document.pm I added two new parameters: JAVASCRIPT and ONLOAD and set 
>> them
>> to null in sub ParamsFill.
>> 
>> In Display.pm in sub new I added the following code in place of the plain 
>> body
>> tag.
> [snip]
>> The second page has this section that is manipulated by the javascript,
>> {$consent$} is the variable set on the first page:
>> <CUSTOM ESCAPED="no" >
>> <div id="consent" style="display:none">{$consent$}</div>
>> <div id="response1" style="display:none"> <p><H3> Thank you 
>> for
>> agreeing to participate in this study.</h3></p>
>>              <p>To confirm your decision to participate in this study, 
>> please
>> click <b>Submit</b></p>
>> </div>
>> <div id="response0" style="display:none">
>> <p><H3>Thank you for your consideration.</h3></p>
>> <p>To confirm your decision not to participate in this 
>> study,
>> please click <b>Submit</b></p></div>
>>              <p>Otherwise "Page Back" <img src="/res/img/back.bmp"/> and
>> "Reload" <img src="/res/img/reload.bmp"/> the consent page to change your
>> decision.</p>
>> </CUSTOM>
> here... another time I think what you have to use is a routing stuff 
> (IFROUTE). You can split that page into two different pages...and perform a 
> routing decision based on consent var.
>
> Have I missed/missunderstood something?
>
> stay tuned,
> bugant.
> Skickat av bugant <[email protected]>
> till survey-discussion
>
Skickat av Joel Palmius <[email protected]>
till survey-discussion