view scripts/pjx_checkbox.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
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