From 0a0195fd60ea11a4376d33be8e900454f7e15a16 Mon Sep 17 00:00:00 2001 From: Wouter van Oijen Date: Sun, 16 Oct 2005 20:20:31 +0000 Subject: [PATCH] XHTML Bugfixes --- lib/WebGUI/Form/Button.pm | 6 +++++- lib/WebGUI/Form/Hidden.pm | 4 ++-- lib/WebGUI/Form/Password.pm | 6 ++++-- lib/WebGUI/Form/Submit.pm | 8 ++++++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/WebGUI/Form/Button.pm b/lib/WebGUI/Form/Button.pm index 65733e95c..67032f711 100644 --- a/lib/WebGUI/Form/Button.pm +++ b/lib/WebGUI/Form/Button.pm @@ -89,7 +89,11 @@ Renders a button. sub toHtml { my $self = shift; my $value = $self->fixQuotes($self->{value}); - return '{extras}.' />'; + my $html = '{name}.'" ' if ($self->{name}); + $html .= 'id="'.$self->{id}.'" ' unless ($self->{id} eq "_formId"); + $html .= 'value="'.$value.'" '.$self->{extras}.' />'; + return $html; } 1; diff --git a/lib/WebGUI/Form/Hidden.pm b/lib/WebGUI/Form/Hidden.pm index 165f47567..eea7800af 100644 --- a/lib/WebGUI/Form/Hidden.pm +++ b/lib/WebGUI/Form/Hidden.pm @@ -94,13 +94,13 @@ sub toHtmlAsHidden { =head2 toHtmlWithWrapper ( ) -A synonym for toHtmlAsHidden. +Renders the form field to HTML as a table row. The row is not displayed because there is nothing to display, but it may not be left away because may not be a child of according to the XHTML standard. =cut sub toHtmlWithWrapper { my $self = shift; - return $self->toHtmlAsHidden; + return ''; } diff --git a/lib/WebGUI/Form/Password.pm b/lib/WebGUI/Form/Password.pm index 1629a99f4..2fafaf3c3 100644 --- a/lib/WebGUI/Form/Password.pm +++ b/lib/WebGUI/Form/Password.pm @@ -96,8 +96,10 @@ Renders an input tag of type password. sub toHtml { my $self = shift; - return '{extras}.' />'; + my $html = '{maxLength}.'" ' if ($self->{maxLength}); + $html .= $self->{extras}.' />'; + return $html; } diff --git a/lib/WebGUI/Form/Submit.pm b/lib/WebGUI/Form/Submit.pm index 8dce0f321..7c2650da1 100644 --- a/lib/WebGUI/Form/Submit.pm +++ b/lib/WebGUI/Form/Submit.pm @@ -60,9 +60,13 @@ Renders a button. sub toHtml { my $self = shift; - my $value = $self->fixQuotes($self->{value}); + my $value = $self->fixQuotes($self->{value}); $self->{extras} ||= 'onclick="this.value=\''.WebGUI::International::get(452).'\'"'; - return '{extras}.' />'; + my $html = '{name}.'" ' if ($self->{name}); + $html .= 'id="'.$self->{id}.'" ' unless ($self->{id} eq "_formId"); + $html .= 'value="'.$value.'" '.$self->{extras}.' />'; + return $html; } 1;
'.$self->toHtmlAsHidden.'