in reply to obtaining yyyy-mm-dd via a calendar object
now here's the rub - continuing scholarship in perl has opened the possibility of an alternative approach using the same javascript (calendar widget) but this time within an "html-in-code" solution (see the below perl code) which generates html dynamically. when the static html generated by the "code-in-html" solution, is viewed side-by-side with the dynamic html generated by the "html-in-code" solution, the two htmls generated are materially the same. however of course, while closeness works in horseshoes, it fails in perl execution.<HTML><HEAD><script type='text/JavaScript' src='scw.js'></script></HEA +D><BODY> <FORM action="http://www.e1surveys.com/cgi-bin/testform1.cgi" method=" +POST"> Enter date:<input name='birthdate' id='date1' type='text' value=''/> <img src='calendar.jpg' title='Click Here' alt='Click Here' onclick="scwShow(document.getElementById('date1'),this);" /><br/> Enter your name: <INPUT TYPE="text" NAME="name" SIZE="30"> <BR> <INPUT TYPE="submit" VALUE="Submit" NAME="Submit Button"> <INPUT TYPE="reset" VALUE="Reset" NAME="Reset Button"> </FORM></BODY></HTML>
#! /usr/bin/perl -wT use CGI qw(:standard escapeHTML); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; my $html1 = qq(<script type='text/JavaScript' src='scw.js'></script>); my $html2 = qq(<input name='birthdate' id='date1' type='text' value='' +/> <img src='calendar.jpg' title='Click Here' alt='Click Here' onclick="scwShow(document.getElementById('date1'),this);" /><br/>); print header ($html1), start_html (); print p ("Element names & values submitted in previous form:"); my @names = param (); # get list of parameter names if (!@names) { print p ("(no elements present)"); } else { my @item = (); foreach my $name (@names) { my @val = param ($name); $val[0] = "[" . join (", ", @val) . "]" if @val > 1; push (@item, escapeHTML ("$name: ($val[0])\n")); } print ul (li (\@item)); } print hr (); print start_form (-action => url ()), p ("Enter date:", $html2), br(), p ("Enter your name:", textfield (-name =>"name", -type=>"text", -size +=>"30")), br(), submit (-name => "Submit Button", -value => "Submit"), reset (-name => "Reset Button", -value => "Reset"), end_form (); print end_html (); exit (0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: obtaining yyyy-mm-dd via a calendar object
by rhesa (Vicar) on Jul 26, 2006 at 21:05 UTC | |
by gmacfadden (Sexton) on Jul 31, 2006 at 00:37 UTC | |
by Asim (Hermit) on Jul 31, 2006 at 14:45 UTC | |
by gmacfadden (Sexton) on Aug 03, 2006 at 20:53 UTC | |
by Asim (Hermit) on Aug 03, 2006 at 21:41 UTC | |
|