in reply to javascript through template toolkit to catalyst

...How do I get javascript data to catalyst backend?
Through CGI
  • Comment on Re: javascript through template toolkit to catalyst

Replies are listed 'Best First'.
Re^2: javascript through template toolkit to catalyst
by realn0whereman (Novice) on Mar 29, 2009 at 14:38 UTC
    Ok so i managed to do this without CGI. It's a bit ugly but it works. in my HTML file(technically my .tt2 file) i have this in my javascript area:
    for(m=0;m<selected.length;m++){ document.form.values.value += selected[m].name+','; }
    then I have this in my actual html area:
    <form method="post" name="form" action=" [% Catalyst.uri_for('/agg/su +bmit') %] "> <INPUT TYPE="hidden" NAME="values">
    and then in my catalyst controller ( which is agg.pm with submit as the method) :
    my $selected = $c->request->params->{values};
    from here i can parse the string into an array and proceed with my program.
      That is CGI!!!!
Re^2: javascript through template toolkit to catalyst
by realn0whereman (Novice) on Mar 29, 2009 at 12:11 UTC
    I've been looking and I can't seem to understand how that would work. From what i've read, CGI is for getting perl data into html, and writing html with perl.