Mercurial > boosterpack
comparison scripts/pjx_url.pl @ 0:477258d09353 boosterpack
[svn r1] initial import
author | robert |
---|---|
date | Sun, 30 Aug 2009 02:19:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:477258d09353 |
---|---|
1 #!C:/strawberry/perl/bin/perl.exe | |
2 | |
3 # this is an example script of how you would use URLs to define | |
4 # your CGI::Ajax functions. | |
5 | |
6 use strict; | |
7 use CGI::Ajax; | |
8 use CGI; | |
9 | |
10 my $q = new CGI; | |
11 | |
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); | |
16 | |
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: | |
26 <input type="text" name="val1" id="val1" size="6" | |
27 onkeyup="myfunc( ['Centigrade__' + getVal('val1')], ['val2'] ); | |
28 return true;"> | |
29 <br/> | |
30 | |
31 Degrees Kelvin: | |
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 | |
39 | |
40 return $html; | |
41 }; | |
42 | |
43 print $pjx->build_html($q,$Show_Form); # this outputs the html for the page |