File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ Change history for HTML-Form
22
33{{$NEXT}}
44 - Remove Authority section from dist.ini (GH#27) (Olaf Alders)
5+ - Allow buttons to not have a value (GH#8) (Felix Ostmann and Julien Fiegehenn)
56
676.07 2020-02-21 03:50:52Z
78 - Restore =head1 NAME section to pod for HTML::Form
Original file line number Diff line number Diff line change @@ -1419,6 +1419,7 @@ sub click
14191419 my ($self ,$form ,$x ,$y ) = @_ ;
14201420 for ($x , $y ) { $_ = 1 unless defined ; }
14211421 local ($self -> {clicked }) = [$x ,$y ];
1422+ local ($self -> {value }) = " " unless defined $self -> value;
14221423 return $form -> make_request;
14231424}
14241425
Original file line number Diff line number Diff line change 33use strict;
44use Test qw( plan ok) ;
55
6- plan tests => 127 ;
6+ plan tests => 129 ;
77
88use HTML::Form;
99
@@ -595,3 +595,33 @@ $f = HTML::Form->parse(<<EOT, "http://www.example.com");
595595</form>
596596EOT
597597ok(@warn , 0);
598+
599+ $f = HTML::Form-> parse(<<EOT , base => " http://localhost/" );
600+ <form method=post>
601+ <form action="test" method="post">
602+ <button type="submit" name="submit" value="go">run</button>
603+ </form>
604+ EOT
605+
606+ ok($f -> click-> as_string, <<EOT );
607+ POST http://localhost/
608+ Content-Length: 9
609+ Content-Type: application/x-www-form-urlencoded
610+
611+ submit=go
612+ EOT
613+
614+ $f = HTML::Form-> parse(<<EOT , base => " http://localhost/" );
615+ <form method=post>
616+ <form action="test" method="post">
617+ <button type="submit" name="submit">run</button>
618+ </form>
619+ EOT
620+
621+ ok($f -> click-> as_string, <<EOT );
622+ POST http://localhost/
623+ Content-Length: 7
624+ Content-Type: application/x-www-form-urlencoded
625+
626+ submit=
627+ EOT
You can’t perform that action at this time.
0 commit comments