summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-input-date-field.html
blob: 0618fc965bd507dcdf0aff8a27f5e8be2ec6de06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

<LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
<SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>

<TR>
  <TD ALIGN="right"><% $label %></TD>
  <TD>
    <INPUT TYPE="text" NAME="<% $name %>" ID="<% $name %>_text" VALUE="<% ($value eq '') ? '' : time2str($format, $value) %>">
    <IMG SRC="../images/calendar.png" ID="<% $name  %>_button" STYLE="cursor: pointer" TITLE="Select date">
  </TD>
</TR>

<SCRIPT TYPE="text/javascript">
  Calendar.setup({
    inputField: "<% $name %>_text",
    ifFormat:   "<% $format %>",
    button:     "<% $name %>_button",
    align:      "BR"
  });
</SCRIPT>


<%init>
my($name, $value, $label, $format) = @_;

$format = "%m/%d/%Y" unless $format;
$label = $name unless $label;

</%init>