Skip to content

Commit ca0e979

Browse files
committed
v6.10
- Use "croak" instead of "die" to show errors from the perspective of the caller [RT#20499] (GH#29) (Julien Fiegehenn) - Remove the executable bit from a couple of tests (GH#41) (James Raspass) - <option>s within select fields without a name no longer get merged into the previous select field (GH#2) (Julien Fiegehenn) - find_input() can now take a reference to undef to explicitly find inputs that have no name (GH#2) (Julien Fiegehenn)
1 parent 89da3b8 commit ca0e979

3 files changed

Lines changed: 33 additions & 22 deletions

File tree

Changes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Change history for HTML-Form
22

3-
{{$NEXT}}
3+
6.10 2022-08-22 13:20:12Z
44
- Use "croak" instead of "die" to show errors from the perspective of the
55
caller [RT#20499] (GH#29) (Julien Fiegehenn)
66
- Remove the executable bit from a couple of tests (GH#41) (James Raspass)

META.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,39 +80,39 @@
8080
"provides" : {
8181
"HTML::Form" : {
8282
"file" : "lib/HTML/Form.pm",
83-
"version" : "6.09"
83+
"version" : "6.10"
8484
},
8585
"HTML::Form::FileInput" : {
8686
"file" : "lib/HTML/Form.pm",
87-
"version" : "6.09"
87+
"version" : "6.10"
8888
},
8989
"HTML::Form::IgnoreInput" : {
9090
"file" : "lib/HTML/Form.pm",
91-
"version" : "6.09"
91+
"version" : "6.10"
9292
},
9393
"HTML::Form::ImageInput" : {
9494
"file" : "lib/HTML/Form.pm",
95-
"version" : "6.09"
95+
"version" : "6.10"
9696
},
9797
"HTML::Form::Input" : {
9898
"file" : "lib/HTML/Form.pm",
99-
"version" : "6.09"
99+
"version" : "6.10"
100100
},
101101
"HTML::Form::KeygenInput" : {
102102
"file" : "lib/HTML/Form.pm",
103-
"version" : "6.09"
103+
"version" : "6.10"
104104
},
105105
"HTML::Form::ListInput" : {
106106
"file" : "lib/HTML/Form.pm",
107-
"version" : "6.09"
107+
"version" : "6.10"
108108
},
109109
"HTML::Form::SubmitInput" : {
110110
"file" : "lib/HTML/Form.pm",
111-
"version" : "6.09"
111+
"version" : "6.10"
112112
},
113113
"HTML::Form::TextInput" : {
114114
"file" : "lib/HTML/Form.pm",
115-
"version" : "6.09"
115+
"version" : "6.10"
116116
}
117117
},
118118
"release_status" : "stable",
@@ -129,7 +129,7 @@
129129
"x_IRC" : "irc://irc.perl.org/#lwp",
130130
"x_MailingList" : "mailto:libwww@perl.org"
131131
},
132-
"version" : "6.09",
132+
"version" : "6.10",
133133
"x_Dist_Zilla" : {
134134
"perl" : {
135135
"version" : "5.028000"
@@ -339,7 +339,7 @@
339339
}
340340
},
341341
"name" : "Test::Portability",
342-
"version" : "2.001000"
342+
"version" : "2.001001"
343343
},
344344
{
345345
"class" : "Dist::Zilla::Plugin::Test::EOL",
@@ -668,7 +668,7 @@
668668
"branch" : null,
669669
"changelog" : "Changes",
670670
"signed" : 0,
671-
"tag" : "v6.09",
671+
"tag" : "v6.10",
672672
"tag_format" : "v%V",
673673
"tag_message" : "v%V"
674674
},

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ HTML::Form - Class that represents an HTML form element
44

55
# VERSION
66

7-
version 6.09
7+
version 6.10
88

99
# SYNOPSIS
1010

@@ -175,18 +175,29 @@ The following methods are available:
175175
inputs that match the arguments given are returned. In scalar context
176176
only the first is returned, or `undef` if none match.
177177

178-
If $selector is not `undef`, then the input's name, id, class attribute must
179-
match. A selector prefixed with '#' must match the id attribute of the input.
180-
A selector prefixed with '.' matches the class attribute. A selector prefixed
181-
with '^' or with no prefix matches the name attribute.
178+
If `$selector` is not `undef`, then the input's _name_, _id_ or _class_
179+
attribute must match.
180+
A selector prefixed with '#' must match the _id_ attribute of the input.
181+
A selector prefixed with '.' matches the _class_ attribute. A selector prefixed
182+
with '^' or with no prefix matches the _name_ attribute.
182183

183-
If $type is not `undef`, then the input must have the specified type.
184+
my @by_id = $form->find_input( '#some-id' );
185+
my @by_class = $form->find_input( '.some-class' );
186+
my @by_name = $form->find_input( '^some-name' );
187+
my @also_by_name = $form->find_input( 'some-name' );
188+
189+
If you want to find an input that has no _name_ at all, pass in a reference
190+
to `undef`.
191+
192+
my @nameless_inputs = $form->find_input( \undef );
193+
194+
If `$type` is not `undef`, then the input must have the specified type.
184195
The following type names are used: "text", "password", "hidden",
185196
"textarea", "file", "image", "submit", "radio", "checkbox" and "option".
186197

187-
The $index is the sequence number of the input matched where 1 is the
188-
first. If combined with $name and/or $type, then it selects the _n_th
189-
input with the given name and/or type.
198+
The `$index` is the sequence number of the input matched where 1 is the
199+
first. If combined with `$selector` and/or `$type`, then it selects the
200+
_n_th input with the given _name_ and/or type.
190201

191202
- $value = $form->value( $selector )
192203
- $form->value( $selector, $new\_value )

0 commit comments

Comments
 (0)