view BoosterPack/scripts/.svn/text-base/pjx_formDump.pl.svn-base @ 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;
6 my $q = new CGI;
8 my $concatter = sub {
9 my $str = "All Values Are <br/>\n";
10 map { $str .= ' and ' . $_ } @_;
11 print STDERR $str;
12 return $str;
13 };
15 my $Show_Form = sub {
16 my $html = "";
17 $html = <<EOT
18 <HTML>
19 <HEAD><title>CGI::Ajax Multiple Return Value Example</title>
20 </HEAD>
21 <BODY>
22 <form>
23 <input type="text" id="val1" size="6" value=2 ><br/>
24 <input type="text" id="val2" size="6" value=hello ><br/>
25 <input type='text' id='val3' size=6 value=34><br/>
26 <input type='text' id='val4' size=8 value='something'><br/>
27 <input type='text' id='val5' size=6 value='\$123.39'><br/>
28 <input type='text' id='val6' size=6 value='address'><br/>
29 <input type='text' id='val7' size=9 value='123 fake st'><br/>
30 <input type='text' id='val8' size=9 value='some input'><br/>
31 <input type='text' id='val9' size=9 value=another><br/>
32 <select id='fred'>
33 <option value='1234'>1234
34 <option value='abcd' SELECTED >abcd
35 <option value='zxyw'>zxyw
36 </select>
37 <br/>
38 <button onclick='jsFunc(formDump(),["out"]);return false' > Send In All Form Elements </button>
39 <div id="out">
40 </div>
43 </form>
44 </BODY>
45 </HTML>
46 EOT
47 ;
49 return $html;
50 };
53 my $pjx = CGI::Ajax->new( 'jsFunc' => $concatter);
54 $pjx->JSDEBUG(2);
55 $pjx->DEBUG(1);
56 print $pjx->build_html($q,$Show_Form); # this outputs the html for the page