|
thanks for everyone's help. I was able to get
the info.
----- Original Message -----
Sent: Tuesday, November 26, 2002 11:32
AM
Subject: RE: Javascript and Perl
Help!!
Yes. The results from javascript can be put into hidden fields
and passed to the perl script behind the form that contains
javascript.
crude example:
<head> <SCRIPT language="JAVASCRIPT">
<!--
function checkForm(){ var location =
document.SearchForm.location.value; eval
(document.SearchForm.hidden_field.value =
location;); document.SearchForm.submit();
return true; }
// -->
</SCRIPT>
<title>Test Form</title>
<center> <form name= "SearchForm"
action="">
<input type="text" size="20" maxlength="20"
name="location"> <input type="hidden" name="hidden_field"
value=""> <input type="button" value="enter data" >
</form>
PERL Script:
#!c:\perl\bin\perl.exe
=pod =head1 Test
script =head2 =over 4
=item 1
Function: Script pulls data from hidden field.
=back =cut
use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser);
my ($hidden_field);
$cgi = new CGI; $hidden_field =
$cgi->param('hidden_field');
&do_something($hidden_field);
exit(0);
Is there anyway to take the results of Javascript code and use them in
Perl?
For example I have code that retrieves a cookie. I want to use
the value of that cookie in Perl to run some mySQL queries. Can anyone
help?
|