Subject: | HTML::Form::ImageInput does not include value="" on click [patch] |
When telling LWP to click on an input of type "image", the x and y
coordinates are transmitted to the server. However, if there is a
value="foo" attribute present, that value is not passed along.
Attached is a suggested patch to HTML::Form which includes a value, if
present, as part of the request.
Subject: | Form.patch |
--- /usr/lib/perl5/site_perl/5.8.8/HTML/Form.pm 2009-07-07 14:29:33.000000000 -0500
+++ Form.pm 2010-03-11 14:11:50.000000000 -0600
@@ -1401,7 +1401,15 @@
return if $self->{disabled};
my $name = $self->{name};
$name = (defined($name) && length($name)) ? "$name." : "";
- return ("${name}x" => $clicked->[0],
+
+ my %more = ();
+ if ($name ne '' && defined($self->{value})) {
+ $more{ $self->{name} } = $self->{value};
+ }
+
+
+ return (%more,
+ "${name}x" => $clicked->[0],
"${name}y" => $clicked->[1]
);
}