Fix Hidden, Radio and Checkbox, which wouldn't allow
a value of zero to be set in them. It was translated to the empty string.
This commit is contained in:
parent
fd7a1d28a1
commit
c930c73d67
6 changed files with 70 additions and 7 deletions
|
|
@ -118,7 +118,8 @@ Renders and input tag of type checkbox.
|
|||
|
||||
sub toHtml {
|
||||
my $self = shift;
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->getDefaultValue))) || '';
|
||||
my $value = $self->getDefaultValue;
|
||||
$value = defined $value ? $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($value))) : '';
|
||||
my $checkedText = $self->get("checked") ? ' checked="checked"' : '';
|
||||
my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : '';
|
||||
return '<input type="checkbox" name="'.($self->get("name")||'').'" value="'.$value.'"'.$idText.$checkedText.' '.($self->get("extras")||'').' />';
|
||||
|
|
|
|||
|
|
@ -97,7 +97,8 @@ Renders an input tag of type hidden.
|
|||
|
||||
sub toHtmlAsHidden {
|
||||
my $self = shift;
|
||||
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->getDefaultValue))) || '';
|
||||
my $value = $self->getDefaultValue;
|
||||
$value = defined $value ? $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($value))) : '';
|
||||
my $idText = $self->get('id') ? ' id="'.$self->get('id').'" ' : '';
|
||||
return '<input type="hidden" name="'.($self->get("name")||'').'" value="'.$value.'" '.($self->get("extras")||'').$idText.' />'."\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue