Click here to get back home

HTML::Form, Multiple select Elements with Same name

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
HTML::Form, Multiple select Elements with Same name David Marshall 07-30-2004
Get Chitika Premium
Posted by David Marshall on July 30, 2004, 3:48 pm
Please log in for more thread options
Hi all,

I have a form that has multiple <select> elements that have the same
name. This is so that the destination script can deal with all of them
as an array. <select multiple> is not appropriate because the order in
which options are chosen is significant.

A simple version of the form might be

<form action="foo.pl" method="POST">
<select name="m">
<option>a
<option>b
<option>c
</select>
<select name="m>
<option>a
<option>b
<option>c
</select>
<input type="submit">
</form>

Works great. The handler script works wonderfully.

However, when I try to test it all with WWW::Mechanize, there's a
problem with HTML::Form, which parses it out to be (effectively) a
single select with 6 options.

I don't see anyway to make HTML/Form.pm parse this correctly without one
of several really unpleasant modifications. I don't want to have to
change the names of the <select> elements to be unique (e.g. m1, m2),
because then I'd have to add code to the handler script to put these
parameters into an array. I get that effect automatically with the
current naming.

Comments/thoughts/suggestions?


Similar ThreadsPosted
WWW::Mechanize module: multiple Select. July 13, 2004, 7:36 pm
Looking for AJAX HTML Table Form Module August 15, 2007, 11:29 am
www::mechanize $mech->select February 4, 2005, 5:01 pm
XML::LibXML and getting data from elements/nodes October 26, 2004, 7:50 pm
Error-flag references to non-existing hash elements? March 8, 2005, 1:08 pm
WWW::Mechanize "There is no Form named (...)" December 8, 2004, 5:58 am
WWW::Mechanize cannot find the form. February 14, 2006, 9:04 pm
form submission automation August 13, 2006, 9:15 pm
Getting WWW::Mechanize to submit a form September 15, 2007, 3:44 pm
HTTP::Mechanize / file-form October 13, 2006, 10:16 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap