I'm using HTML::FormHandler and building the form dynamically like so:
my $form = HTML::FormHandler->new(
name => 'types',
field_list => [
parent_id => {
type => 'Select',
label => 'Parent',
required => 1,
options => [{value=>'test',label=>'test'}],
},
],
);
Whenever I only pass in one option like above, this is the output that is rendered for the form:
<select name="parent_id" id="parent_id">
<option id="parent_id.0" value="test"> </option>
<option id="parent_id.1" value="test"> </option>
</select>
However, the resulting output should be:
<select name="parent_id" id="parent_id">
<option id="parent_id.0" value="test">test</option>
</select>
But once I add one more option, such as this:
options => [{value=>'test',label=>'test'},{value=>'test2',label=>'test2'}],
Then the output renders correctly and becomes:
<select name="parent_id" id="parent_id">
<option id="parent_id.0" value="test">test</option>
<option id="parent_id.1" value="test2">test2</option>
</select>
Is this a bug on HTML::FormHandler
's part, or is theres something I'm missing here? Thanks!