On 6/6/07, Bill Ward <[EMAIL PROTECTED]> wrote:
On 6/4/07, Josh Rosenbaum <[EMAIL PROTECTED]> wrote:
> Rajkumar Natarajan wrote:
> > I am using Javascript to read a cookie. Now,  I want  to pass the
> > value  to  TT2.
> > How to pass javascript(vari)  to TT2(rate_email)  ?
> [SNIP]
>
> Javascript is processed in the browser (client-side), not by TT(server-side). 
You should be accessing the cookie via your backend/TT without the use of 
javascript.

The TT can place the value into a hidden field or generate a snippet
of JavaScript code to populate a variable....one of these should do:

<input type="hidden" name="something" value="[% something %]" />
<script>var something='[% something %]';</script>

Oh sorry I read the original question backward.

Your JavaScript could modify the value of the hidden field, and then
submit it as form data.  But that has nothing to do with TT; it's
basic CGI.

Or get clever with Ajax if you like, I suppose.

--Bill.

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to