473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

passing variable's value from javascript and receiving in perl script

how can i pass a variable's value from javascript to perl script?
how can i receive that value in the perl script?

please help me!!!
Sep 11 '07 #1
6 2005
KevinADC
4,059 Expert 2GB
You have to us a form to pass your javascript values to a perl script.
Sep 11 '07 #2
i am new to both javascript and perl script. can u please explain me with sample codes?
Sep 11 '07 #3
numberwhun
3,509 Expert Mod 2GB
Well, we are not able to help you with the javascript. You will have to go over to that forum. As far as the Perl part goes, you will need to learn Perl and also have to look up a tutorial on form processing with Perl. Google is your friend.

Once you have some code and need help troubleshooting it, go ahead and post it here and we will help you.

Regards,

Jeff
Sep 11 '07 #4
thanks a lot! :)

thanks and regards,
satish
Sep 12 '07 #5
KevinADC
4,059 Expert 2GB
i am new to both javascript and perl script. can u please explain me with sample codes?

This makes no sense to me. If you are new to javascript and perl how is it that you are asking this question? What are you trying to do or thinking?
Sep 12 '07 #6
Kelicula
176 Expert 100+
What I would do is create a form element in the html page that has the javascript, and then you can grab it in perl with the CGI module. If you don't want the user to see it make it a hidden form element.

If you wanted the persons first and last name to pass from javascript to perl
Here is an example:

[HTML]<html><head><title>Title</title>

<script language="javascript" type="text/javascript">
<!--

function doIt(){

var fname = document.theForm.First.value();
var lname= document.theForm.Last.value();

document.theForm.flname.value=fname+" "+lname;

}


//->

</head>
<body>

<form name=theForm method=get action=perlScript>

<input type=hidden name=flname>
Type your first name:
<input type=text name=First>
Type your last name:
<input type=text name=Last>

<input type=submit onclick="javascript:doIt();">

</form>
</body>
</html>[/HTML]


Then in perl:

Expand|Select|Wrap|Line Numbers
  1. use CGI qw/:standard/;
  2.  
  3. $name = param('flname');
  4.  
  5. print $name;
  6.  
  7.  
this should return (or more correctly display) their first and last name.
The html, and javascript, and perl I wrote is very crude, but hey it's not my project right?

You should get the idea...
Sep 14 '07 #7

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

Similar topics

1
by: Patrice | last post by:
Hi, I'm trying to use a javascript function passing a vb variable. I don't understand why it doesn't work. Can someone help me? Thanks in advance. Here is my javascript function used to...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
26
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function...
1
by: Marty Meyers | last post by:
TIA for your help! I have a page (code snip below) named "browse" which has a table in it with rows like this: 2003 1500 Silverado pickup red 51,024 $19,995 Details --------- each row...
3
by: stahl.karl | last post by:
I have a CGI/Perl program that returns a string output. Is it possible to get this into a Javascript variable, where the name of the variable is defined in the Javascript and not in the Perl code?...
2
by: pleaseexplaintome | last post by:
Hi I have the following perl/cgi script snippet. The goal of this script is to pass a javascript variable to perl where it can be re-used later. Any help is appreciated, Thanks ...
8
by: Harch84 | last post by:
Hi I have a html page with javascript in it that assigns a set of coordinates to javascript variables. The question I have is how can I then send these variables to a Perl CGI script using a...
1
by: satish2112 | last post by:
Hi, I have a text-area which contains values from mysql database and 2 buttons, Edit and Update. When I click on the Edit button, I can edit the text-area (initially non-editable). After this,...
2
by: satish2112 | last post by:
how can i pass a variable's value from javascript to perl script? how can i receive that value in perl script? Please help me!!!
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.