<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Something like this?<div class="">You can get lost in the ‘IF, AND, OR’ stuff but it could be a start.</div><div class="">Gert</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class="">package App;</div></div><div class=""><div class="">use Dancer2;</div></div><div class=""><div class="">use Data::Dumper;</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">get '/' => sub {</div></div><div class=""><div class=""> return <<'HTML';</div></div><div class=""><div class=""><form action="/q-1" method="GET"></div></div><div class=""><div class=""><p>Did you ever drink coffee?</p></div></div><div class=""><div class=""><input type="text" name="coffee"></div></div><div class=""><div class=""><p>What is your age?</p></div></div><div class=""><div class=""><input type="text" name="age"></div></div><div class=""><div class=""><input type="submit"></div></div><div class=""><div class=""></form></div></div><div class=""><div class="">HTML</div></div><div class=""><div class="">};</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">get '/q-1' => sub {</div></div><div class=""><div class=""> my %FIELD;</div></div><div class=""><div class=""> my @field_names = qw(coffee age);</div></div><div class=""><div class=""> foreach my $field_name (@field_names) {</div></div><div class=""><div class=""> if ( defined param("$field_name") ) {</div></div><div class=""><div class=""> $FIELD{$field_name} = param("$field_name");</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""> print Dumper \%FIELD;</div></div><div class=""><div class=""> if ( $FIELD{'coffee'} eq "yes" && $FIELD{'age'} >= 16 ) {</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class=""> # redirect '/more-questions';</div></div><div class=""><div class=""> redirect '/bike';</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""> else {</div></div><div class=""><div class=""> redirect '/other-questions';</div></div><div class=""><div class=""> }</div></div><div class=""><div class=""> if ( $FIELD{'age'} > 16 ) {</div></div><div class=""><div class=""> redirect '/bike';</div></div><div class=""><div class=""> }</div></div><div class=""><div class="">};</div></div><div class=""><div class=""><br class=""></div></div><div class=""><div class="">get '/more-questions' => sub {</div></div><div class=""><div class=""> return "More questions";</div></div><div class=""><div class="">};</div></div><div class=""><div class="">get '/other-questions' => sub {</div></div><div class=""><div class=""> return "Other questions";</div></div><div class=""><div class="">};</div></div><div class=""><div class="">get '/bike' => sub {</div></div><div class=""><div class=""> return "In my country you may ride a scooter though it is better to bike!";</div></div><div class=""><div class="">};</div></div><div class=""><div class="">App->to_app;</div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 16 Feb 2021, at 00:26, Richard Reina <<a href="mailto:gatorreina@gmail.com" class="">gatorreina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I have a friend who needs me to develop a page which is a long survey, There is some skip logic needed, for example, if users birthday is before x date skip to question 5, if answer to question 12 is 'no' skip to question 16, but nothing too complicated. I nevertheless am struggling with how to design such a route and was wondering if anyone perhaps knew of any similar examples.<div class=""><br class=""></div><div class="">Rciahrd</div></div>
_______________________________________________<br class="">dancer-users mailing list<br class=""><a href="mailto:dancer-users@lists.preshweb.co.uk" class="">dancer-users@lists.preshweb.co.uk</a><br class="">https://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br class=""></div></blockquote></div><br class=""></div></body></html>