view 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
line wrap: on
line source
1 #!C:/strawberry/perl/bin/perl.exe
2 use strict;
3 use CGI::Ajax;
4 use CGI;
7 my $perl_func = sub {
8 my $input = shift;
10 print "got $input";
11 };
13 sub Show_HTML {
14 my $html = "";
15 $html .= <<EOT;
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']); />
25 <div id="out"> </div>
26 </body>
27 </html>
28 EOT
30 return $html;
31 }
33 my $cgi = new CGI(); # create a new CGI object
35 my $pjx = new CGI::Ajax( 'jsFunc' => $perl_func );
36 $pjx->JSDEBUG(1);
37 $pjx->DEBUG(1);
39 print $pjx->build_html($cgi,\&Show_HTML); # this outputs the html for the page