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