DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   How to pass the values of javascript in perl (http://www.daniweb.com/forums/thread43283.html)

manish Kishore Apr 13th, 2006 11:28 am
How to pass the values of javascript in perl
 
Hi All,
I want to pass the value of java script variable in perl?
how can I do that.

Please help me.

Thanks

tgreer Apr 13th, 2006 12:01 pm
Re: How to pass the values of javascript in perl
 
You cannot. JavaScript is client-side, Perl is server-side. The only thing a web page can do is request a Perl-driven page, and the Request is either GET (pass the values on the querystring) or Post (pass the values in a Form).

So a typical technique is to have a hidden element on the form, set its value via Javascript, and then submit the form.

vonfeldt Sep 27th, 2006 11:19 pm
Re: How to pass the values of javascript in perl
 
if you could post a snippet, i'll reply an example of what tgreer is getting at.

cycleops Sep 29th, 2006 7:57 pm
Re: How to pass the values of javascript in perl
 
Not sure which direction you want to pass, but if u want to pass from perl to javascript -- you write out javascript like this snippet:
printf ("var myVariable = %d;", 1);
If that prints inside a javascript section it would assign the value "1" to the variable.
If u want to pass from javascript to perl, try AJAX.


All times are GMT -4. The time now is 4:40 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC