Thanks Tim. You are right as it does not seem to be possible. Its always 0.

On Saturday, 15 October 2016 17:29:15 UTC+5:30, Tim Allingham wrote:
> That's not possible, for the following reason
> - Template variables are processed server side, before passing to the 
> client browser
> - Javascript is executed client side, any changes to the variable (which 
> the browser won't even have a record of) won't reflect back up to the 
> server. By the time your client side JS is executed, the variable doesn't 
> exist, it's just been replaced with the 0 wherever it's been used.
> On Thursday, 13 October 2016 23:52:11 UTC+11, Ragini Prasad wrote:
>> I am creating a variable in template and stashing it. Basically I want to 
>> create a variable in template, modify it in java scripts used in template 
>> and pass it to controller.
>> <% my $pagestatus=0; %>
>> <%= stash "pagestatus" %>
>> I need this variable in controller. I am trying to get it there in this 
>> way:
>> $status= $self->param('pagestatus');
>> This value never gets reflected in my controller. What is the right way 
>> to do it ?

You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to