$selected = ' selected="selected"'
# or
$selected = qq( selected="selected")
is returned as:
selected="selected"
which is an invalid HTML attribute, ofcourse.
How do I fix it?
Edited to add:
<select name="alignment" class="select"
<%== param('feature') ? '' : 'disabled'; %>
>
% foreach (keys %al) {
% my $selected = param('aligment') && param('aligment') eq $_ ? ' selected' : '';
%
% if (!param('aligment') && $_ eq 'left') { $selected = ' selected' }
%
<option value="<%=$_%>" <%= $selected %>>
<%= $al{$_} %>
</option>
%
% }
</select>
Thanks!