Hello,
I would like to define different globals for an ENUM - field (typ: checkbox) that will used in different languages.
Jack has sent me some code from Aki for displaying a list of countries:
sub {
my $tags = GT::Template->tags;
my $e = qq|<select name="Location">|;
my %countries = (
DE_Germany => 'DE: Germany',
UK_United_Kingdom => 'UK: United Kingdom'
);
my $l = $tags->{Location} || '';
foreach my $k ( sort keys %countries ) {
my $is_selected = $l eq $k ? "selected" : "";
$e .= qq{<option value="$k" $is_selected>$countries{$k}</option>};
}
$e .= "</select>";
return $e;
}
How this needs to be changed for working with the checkboxes???
Lars
I would like to define different globals for an ENUM - field (typ: checkbox) that will used in different languages.
Jack has sent me some code from Aki for displaying a list of countries:
sub {
my $tags = GT::Template->tags;
my $e = qq|<select name="Location">|;
my %countries = (
DE_Germany => 'DE: Germany',
UK_United_Kingdom => 'UK: United Kingdom'
);
my $l = $tags->{Location} || '';
foreach my $k ( sort keys %countries ) {
my $is_selected = $l eq $k ? "selected" : "";
$e .= qq{<option value="$k" $is_selected>$countries{$k}</option>};
}
$e .= "</select>";
return $e;
}
How this needs to be changed for working with the checkboxes???
Lars