Subject: | HTML::Form 'button type=submit' tags are not supported (simple patch attached) |
This form cannot be clicked on (HTML::Form->click) because <button> tags
are not parsed:
<form action=foo>
<button type=submit name=buttonsubmit value=1234>Click Me!</button>
</form>
Attached is a 2-line patch. Basically it treats all 'button' tags as
'input' since these two tags are verbially the same:
<button type=submit name=foo value=bar>
<input type=submit name=foo value=bar>
-Eric
Subject: | Form.pm.diff |
--- Form-original.pm 2009-03-03 12:01:36.000000000 -0800
+++ Form.pm 2009-03-03 12:02:09.000000000 -0800
@@ -117,7 +117,7 @@ sub parse
my $p = HTML::TokeParser->new(ref($html) ? $html->decoded_content(ref => 1) : \$html);
eval {
# optimization
- $p->report_tags(qw(form input textarea select optgroup option keygen label));
+ $p->report_tags(qw(form input textarea select optgroup option keygen label button));
};
my $base_uri = delete $opt{base};
@@ -155,6 +155,8 @@ sub parse
my($tag, $attr) = @$t;
last if $tag eq "/form";
+ $tag = 'input' if ($tag eq 'button');
+
# if we are inside a label tag, then keep
# appending any text to the current label
if(defined $current_label) {