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