Subject: | HTML::Form - cannot set anything but the first value in a multi-select field |
The attached test demonstrates the problem. I cannot set the value on a
select-multiple form to anything but the first value. This only effects
<select multiple> and not <select>. I'm taking a stab at a fix but I'm
not optimistic.
Additionally, it would be nice if the value check did not die. In fact,
I'd prefer if it was optional or just went away. There's nothing which
says I must send only the values offered in the form and limiting
HTML::Form users (and thus WWW::Mechanize) that way limits the possible
form hacking one can do.
Subject: | html_form.t |
#!/usr/bin/perl -w
use HTML::Form;
my $form = HTML::Form->parse(<<'HTML', "http://www.example.com/");
<form action="foo.thing">
<select name="chanId">
<option value="130" selected>Anime Network</option>
<option value="119" >COM 250</option>
</select>
</form>
HTML
$form->value('chanId', 130);
$form->value('chanId', 119);
$form = HTML::Form->parse(<<'HTML', "http://www.example.com/");
<form action="foo.thing">
<select name="chanId" MULTIPLE>
<option value="130" selected>Anime Network</option>
<option value="119" >COM 250</option>
</select>
</form>
HTML
$form->value('chanId', 130);
$form->value('chanId', 119);
1;