Mercurial > rlmcintyre
comparison BoosterPack/scripts/pjx_checkbox.pl @ 0:0d795f02a8bb tip
initial committ. what was I thinking?
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 16:57:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0d795f02a8bb |
---|---|
1 #!C:/strawberry/perl/bin/perl.exe | |
2 use strict; | |
3 use CGI::Ajax; | |
4 use CGI; | |
5 | |
6 | |
7 my $perl_func = sub { | |
8 my $input = shift; | |
9 | |
10 print "got $input"; | |
11 }; | |
12 | |
13 sub Show_HTML { | |
14 my $html = ""; | |
15 $html .= <<EOT; | |
16 | |
17 <html> | |
18 <head><title>CGI::Ajax Example</title> | |
19 </head> | |
20 <body> | |
21 <form> | |
22 <input type="checkbox" name="val1" id="val1" value="44" size="6" /> val1<br/> | |
23 <input type='submit' onmouseover=jsFunc(['val1'],['out']); /> | |
24 | |
25 <div id="out"> </div> | |
26 </body> | |
27 </html> | |
28 EOT | |
29 | |
30 return $html; | |
31 } | |
32 | |
33 my $cgi = new CGI(); # create a new CGI object | |
34 | |
35 my $pjx = new CGI::Ajax( 'jsFunc' => $perl_func ); | |
36 $pjx->JSDEBUG(1); | |
37 $pjx->DEBUG(1); | |
38 | |
39 print $pjx->build_html($cgi,\&Show_HTML); # this outputs the html for the page | |
40 |