thank you for the previous responses. they were helpful in the areas of subsequent scholarship. specifically i learned how to accomplish the initial desired task at the bottom of this thread by placing a calendar widget (using javascript) in static HTML - as in the following example static html code and wherein everything works fine. for purposes of differentiation, i shall refer to this solution (following) as the "code-in-html" solution.
<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>
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.
the line of code "print header ($html1)" causes a unexpected user prompt asking if the user wants to download the referenced scw.js javascript file (which already exists in the same directory as my cgi script server side) - - and then the program abends without giving any errors. this does not occur using the static html solution, or if the line of code is changed to "print header ()" - but of course that negates use of the calendar widget'.
in order to grow in my understanding of perl, i would like to pursue the more flexible (ultimatedly), albeit more difficult to implement (at least for me) below "html-in-code" (dynamic html) solution. i get the sense that the root of my problem is within the dynamically generated header data, but don't know how to navigate this obstacle. your help would be welcome. thx.
#! /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);

In reply to Re: obtaining yyyy-mm-dd via a calendar object by gmacfadden
in thread obtaining yyyy-mm-dd via a calendar object by gmacfadden

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.