473,698 Members | 2,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

6 New Member
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 2025
KevinADC
4,059 Recognized Expert Specialist
You have to us a form to pass your javascript values to a perl script.
Sep 11 '07 #2
satish2112
6 New Member
i am new to both javascript and perl script. can u please explain me with sample codes?
Sep 11 '07 #3
numberwhun
3,509 Recognized Expert Moderator Specialist
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
satish2112
6 New Member
thanks a lot! :)

thanks and regards,
satish
Sep 12 '07 #5
KevinADC
4,059 Recognized Expert Specialist
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 Recognized Expert New Member
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><ti tle>Title</title>

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

function doIt(){

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

document.theFor m.flname.value= fname+" "+lname;

}


//->

</head>
<body>

<form name=theForm method=get action=perlScri pt>

<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="javasc ript: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
2574
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 show a text:
12
6548
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 courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
26
45507
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 defined in "A.html", but every attempt results in an "is not a function" error. I have tried to invoke the function using parent.document.funcname(), top.document.funcname(), and various other identifying methods, but all result in the above...
1
1729
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 of the table has a hidden id number which is to be passed on to the
3
6786
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? For example, it seems that the following should work, but it doesn't appear to. Is this valid code? CGI code --- get_string.pl ------ print "Content-type: text/plain\n\n";
2
4873
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 #!/ois/usr/bin/perl -w use strict; use CGI qw(:standard); my $cgi=new CGI; my $flg=0;
8
5488
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 submit on a html form. An example of some of the code below: var map; var geocoder = null; var addressMarker;
1
3300
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, if I click on the Update button, the values in the text-area must be updated in the mysql database. I am storing the values of the text-area in a variable. I am using javascript to pass the variable.
2
1572
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
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9023
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7721
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4615
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.