Re: Parsing a form with identical field names
[email protected] (Alex Malek) Mon, 18 Jul 2011 08:20:00 -0400
| Newsgroups | perl.libwww |
|---|---|
| Message-ID | <CAGH8ccfb9qhkLCYjLkiSjvL5FmoVT=jvuBPq1ScfXkxOtU4LzA@mail.gmail.com> |
Mech via HTML::Form can handle multiple form elements with the same name.
There was a bug a few years ago w/ multiple selects of the same name
but that was fixed in libwww-perl 5.813 in 2008.
There are a few ways to do this, one is:
$mech->field( $name, $value, $index );
Where $index is the number of the form element starting at 1 and
$value is either a scalar or if it is a select it can also be a
hashref of the form {n => $n}
-----Alex Malek