Subject: | HTML::Form::possible_values returns disabled values |
Disabled values are returned in 'possible_values' method (the valuses
which has <option
disabled="disabled"...).
Test case attached.
I think solution is to filter out disabled items in 'possible_values'.
Thank you in advance!
Subject: | test.pl |
#! /usr/bin/perl
use strict;
use warnings;
use HTML::Form;
local $/;
my $html = <DATA>;
my $form = HTML::Form->parse($html, 'localhost');
my $sel = $form->find_input('test');
$sel->value(($sel->possible_values)[2]);
__DATA__
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<form action="test" method="post">
<select name="test">
<option value="1">One</option>
<option value="2">Two</option>
<option disabled="disabled" value="3">Three</option>
</select>
<input type="submit" name="submit" value="Go">
</form>
</body>
</html>