2015-09-21 13:20 GMT-05:00 Andrew Beverley <andy@andybev.com>:
On Mon, 2015-09-21 at 13:09 -0500, Richard Reina wrote:
> I have learned how to display variables in template toolkit with <%
> varname %>. However, these variables are being named from withing my
> dancer app and displayed on the template. Is there a way to display
> variables that a user is entering as they are entering it.

Not as part of TT - that all happens server side.

>  So that if I have a menu like form where a user can pick several
> items and see them each added one by one in a list format before
> pressing a second submit button that submits his entire lists of
> entries? It would be a bit like a shopping cart but instead of the
> items being put in the cart they are displayed right there in the form
> as they are added.

In which case you have 2 options:

1. Process it client-side with javascript (not recommended)
2. Make each "addition" a new request, and store server-side

Hi Andy,

So if I have the users choices (that I want to re-display as a list) coming back in the POST. Once I have turned them into a session variable what is the best way to re-request the page? Should I just do a redirect or would some other method be better?

post '/featadd' => sub { # let user enter info

      my $input_hash = { 
      
      game_id => param('game_id'), 
      spsrd_chlg_id => param('spsrd_chlg_id'),
      period => param('period'),
 
      };

      session list_hash => $input_hash;   

};

#re-request the page and display list_hash ??