view scripts/pjx_url.pl @ 0:477258d09353 boosterpack

[svn r1] initial import
author robert
date Sun, 30 Aug 2009 02:19:26 -0400
parents
children
line wrap: on
line source
1 #!C:/strawberry/perl/bin/perl.exe
3 # this is an example script of how you would use URLs to define
4 # your CGI::Ajax functions.
6 use strict;
7 use CGI::Ajax;
8 use CGI;
10 my $q = new CGI;
12 # the format here implies that 'convert_degrees.pl' is at the same
13 # level in the web server's document root as this script.
14 my $pjx = CGI::Ajax->new( 'myfunc' => 'convert_degrees.pl');
15 $pjx->JSDEBUG(1);
17 my $Show_Form = sub {
18 my $html = "";
19 $html .= <<EOT;
20 <HTML>
21 <HEAD><title>CGI::Ajax Outside URL Example</title>
22 </HEAD>
23 <BODY>
24 <form>
25 Degrees Centigrade:&nbsp;
26 <input type="text" name="val1" id="val1" size="6"
27 onkeyup="myfunc( ['Centigrade__' + getVal('val1')], ['val2'] );
28 return true;">
29 <br/>
31 Degrees Kelvin:&nbsp;
32 <input type="text" name="val2" id="val2" size="6"
33 onkeyup="myfunc( ['Kelvin__' + getVal('val2')], ['val1'] );
34 return true;">
35 </form>
36 </BODY>
37 </HTML>
38 EOT
40 return $html;
41 };
43 print $pjx->build_html($q,$Show_Form); # this outputs the html for the page