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:
- use CGI qw/:standard/;
-
-
$name = param('flname');
-
-
print $name;
-
-
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...