4 Einträge, 1 Seite |
1
2
3
4
5
6
7
<select name="gender">
<option value="3"<TMPL_IF Gender_3> selected>>keine Angabe</option>
<option value="1"<TMPL_IF Gender_1> selected>>frau</option>
<option value="2"<TMPL_IF Gender_2> selected>>mann</option>
</select>
1
2
3
4
5
6
7
<select name="gender">
<TMPL_SWITCH Gender>
<option value="3"<TMPL_CASE 3> selected</TMPL_CASE>>keine Angabe</option>
<option value="1"<TMPL_CASE 1> selected</TMPL_CASE>>frau</option>
</TMPL_SWITCH>
</select>
1
2
3
4
5
6
$template->param(
Gender => $cgi->popup_menu (
-name => 'gender',
-values => ... usw.
),
);
1
2
3
4
5
6
7
8
9
10
11
my @cities = qw(Berlin Hamburg North_Adams);
my $htc = HTML::Template::Compiled->new(
scalarref => \"<select><%html_option cities %></select>",
plugin => [qw(::HTML_Tags)],
);
$htc->param(
cities => [
1, # selected
map { [$_, $cities[$_]] } 0..$#cities],
);
1
2
3
<select><option value="0" >Berlin</option>
<option value="1" selected="selected">Hamburg</option>
<option value="2" >North_Adams</option></select>
4 Einträge, 1 Seite |