From bf9fdd53f102e155bef225f519ee4635a1dddf9d Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 22 Aug 2002 05:02:16 +0000 Subject: [PATCH] Added options to turn off the date on the date method and to add extra info to the form table. --- lib/WebGUI/HTMLForm.pm | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/WebGUI/HTMLForm.pm b/lib/WebGUI/HTMLForm.pm index 1bd3e67de..9c9023e7e 100644 --- a/lib/WebGUI/HTMLForm.pm +++ b/lib/WebGUI/HTMLForm.pm @@ -292,7 +292,7 @@ sub combo { #------------------------------------------------------------------- -=head2 date ( name [ label, value, extras, subtext, size ] ) +=head2 date ( name [ label, value, extras, subtext, size, noDate ] ) Adds a date row to this form. @@ -326,10 +326,15 @@ sub combo { The number of characters wide this form element should be. There should be no reason for anyone to specify this. +=item noDate + + By default a date is placed in the "value" field. Set this to "1" + to turn off the default date. + =cut sub date { - my ($subtext, $class, $output, $name, $label, $extras, $size, $value); + my ($subtext, $noDate, $class, $output, $name, $label, $extras, $size, $value); $class = shift; $name = shift; $label = shift; @@ -338,6 +343,8 @@ sub date { $extras = shift; $subtext = shift; $size = shift || 10; + $noDate = shift; + $value = "" if ($noDate); $output = ''; $output .= ''; - $header .= '' unless ($noTable); + $header .= '
' unless ($noTable); $footer = '
' unless ($noTable); $footer .= ''; bless {_noTable => $noTable, _header => $header, _footer => $footer, _data => ''}, $class;