Hi,

I have been working with HTML::Form lately and have needed to extract the descriptions as well as the values out of <OPTION> tags.

According to the source, the value is the only attribute that is saved.

Attached is a very minor patch that adds a description field to the <OPTION> tag's attribute.

Thanks for all of the great fun!

Cheers,

Christopher Taranto

--- c:/perl/site/lib/HTML/Form.pm.org   Mon Mar 17 10:35:38 2003
+++ c:/perl/site/lib/HTML/Form.pm       Mon Mar 17 10:40:50 2003
@@ -113,7 +113,8 @@
                        next if $tag eq "/option";
                        if ($tag eq "option") {
                            my %a = (%$attr, %{$t->[0]});
-                           $a{value} = $p->get_trimmed_text
+                           $a{description} = $p->get_trimmed_text;
+                $a{value} = $a{description}
                                unless defined $a{value};
                            $f->push_input("option", \%a);
                        } else {








Reply via email to