i'm trying to write a sub function that
will write a date drop down box onto a
form
this function is going to be called from many pages
and should therefore be in another file
i'm figuring that i'll call the function like
<form action="foo.asp">
<!--#include virtual="/actest/vtt/includes/DateDropdownSelector.a
+sp" -->
<% &amp;Month_Dropdown("D1"); %>
</form>
and recieve a dropdown
<%
sub Month_Dropdown ($prefix) {
my @month_order = ("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG"
+,"SEP","OCT","NOV","DEC");
my %month_days = (
JAN => 31,
FEB => 29,
MAR => 31,
APR => 30,
MAY => 31,
JUN => 30,
JUL => 31,
AUG => 31,
SEP => 30,
OCT => 31,
NOV => 30,
DEC => 31
);
$response->write(qq!<select name="! . $prefix . qq! _MONTH">!);
foreach $month (@month_order) {
$response->write(qq! <option value="$month">$month!
+);
};
$response->write(qq!</select>!);
$response->write(qq!<select name="! . $prefix . qq! _DAY">!);
for ($i = 1;$i <= 31;$i++) {
$response->write(qq! <option value="$i">$i!);
};
$response->write(qq!<input type="text" name="! . $prefix . qq!_YEA
+R" maxlength=4 value="2001">!);
}
%>
the hash table is in place so i can eventually
figure out how to create a dropdown pair on which
the number of available days changes based on the
month that is selected
maybe i shouldn't be including the file as a virtual
include but should instead put a 1; at the bottom and
say
require /includes/DateDropdownSelector.pm
and then of course fiddle around with the internals a bit
(come to think of it, just taking out the <% and %> should
complete that transformation
anyways ... i know there's a mega -expert out there who can get me over this last little hurdle :)
update:
I forgot to mention that the error that i am recieving is as follows:
PerlScript Error error '80004005'
(in cleanup) Can't call method "write" on an undefined value
/actest/vtt/includes/DateDropdownSelector.asp, line 19