Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 23985
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.20
Fixed in: (no value)



Subject: [PATCH] implement a "form_id" method analogous to form_name()
In xhtml strict, the "name" attribute is not allowed on <form> tags. Instead, the "id" attribute should be used. Below is a simple implementation of a new form_id() method. It is just like form_name() except for the attribute it checks. Chris sub form_id { my ($self, $formid) = @_; my $temp; my @matches = grep {defined($temp = $_->attr('id')) and ($temp eq $formid) } $self->forms; if ( @matches ) { $self->warn( "There are ", scalar @matches, " forms with id $formid. The first one was used." ) if @matches > 1; return $self->{form} = $matches[0]; } else { $self->warn( qq{ There is no form with id "$formid"} ); return undef; } }
Moved to the new google code queue.