By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

Assigning JavaScript variable to a Perl variable

100+
P: 129
Hello friends,
IN modperl we write perl with html,javascript and etc. when we are writing perl code in the middle of javascript and if we want to assign a javascript variable to a perl variable, how it is possible?(Without using Ajax). Urgent friends
Jun 9 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Once the page has loaded, Perl doesn't run any longer, so if you want to set a Perl variable to a JavaScript one, you will need to reload the page with the JavaScript value attached to the URL or you can do a form submit with a hidden input field.

Post some code as an example of what you're trying to do.
Jun 9 '08 #2

100+
P: 129
Once the page has loaded, Perl doesn't run any longer, so if you want to set a Perl variable to a JavaScript one, you will need to reload the page with the JavaScript value attached to the URL or you can do a form submit with a hidden input field.

Post some code as an example of what you're trying to do.
Friend,
I don't want to be page refreshed also.
function clk(frm)
{
var sel = document.frm.cat.value;
print <<HTML;
$v = sel;
HTML
I am trying with this code, so it is not assigning.
Jun 10 '08 #3

acoder
Expert Mod 15k+
P: 16,027
If you want to avoid a page refresh, you'll have to use Ajax or (i)frames. Perl cannot run on the same page once it's loaded in the way you want it to.
Jun 10 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.