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