develooper Front page | perl.libwww | Postings from March 2003

Patch to HTML::Form for an <OPTION> tag description attribute

Thread Next
From:
Christopher Taranto
Date:
March 17, 2003 11:02
Subject:
Patch to HTML::Form for an <OPTION> tag description attribute
Message ID:
4.3.2.7.2.20030317104816.03cf13b0@130.94.22.245
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 {




  


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About