Skip Menu |
 

This queue is for tickets about the HTML-FillInForm CPAN distribution.

Report information
The Basics
Id: 75933
Status: open
Priority: 0/
Queue: HTML-FillInForm

People
Owner: Nobody in particular
Requestors: ishigaki [...] cpan.org
Cc:
AdminCc:

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



Subject: new HTML5 input type support
Download (untitled) / with headers
text/plain 178b
Hi. "Changes" file says new html5 input types are supported in HTML::FillInForm 2.1, but apparently the feature is missing. Here's a patch to fix and a test to confirm. Thanks.
Subject: fillinform_html5.patch
diff --git a/lib/HTML/FillInForm.pm b/lib/HTML/FillInForm.pm index 07a6d94..22c4aa4 100644 --- a/lib/HTML/FillInForm.pm +++ b/lib/HTML/FillInForm.pm @@ -273,7 +273,7 @@ sub start { if (defined($value)){ # check for input type, noting that default type is text if (!exists $attr->{'type'} || - $attr->{'type'} =~ /^(text|textfield|hidden|)$/i){ + $attr->{'type'} =~ /^(text|textfield|hidden|tel|search|url|email|datetime|date|month|week|time|datetime\-local|number|range|color|)$/i){ if ( ref($value) eq 'ARRAY' ) { $value = shift @$value; $value = '' unless defined $value; diff --git a/t/27_html5.t b/t/27_html5.t new file mode 100644 index 0000000..3ac999b --- /dev/null +++ b/t/27_html5.t @@ -0,0 +1,35 @@ +use strict; +use warnings FATAL => 'all'; +use Test::More; +use HTML::FillInForm; + +my %data = ( + tel => '00-0000-0000', + search => 'search word', + url => 'http://localhost', + email => 'foo@example.com', + datetime => '2012-10-10T00:00Z', + date => '2012-10-10', + month => '2012-10', + week => '2012-W10', + time => '00:00', + 'datetime-local' => '2012-10-10T00:00', + number => 1, + range => 10, + color => '#000000', +); + +plan tests => scalar keys %data; + +my $html = + '<!doctype html><html><body><form>' . + (join '', map { qq/<input type="$_" name="$_">/ } keys %data) . + '</form></body></html>'; + + +my $result = HTML::FillInForm->new->fill(\$html, \%data); + +for my $key (keys %data) { + my ($input) = $result =~ /(<input[^>]+type="$key"[^>]*>)/; + like $input => qr/value="$data{$key}"/, "filled $key"; +}
Subject: Re: [rt.cpan.org #75933] new HTML5 input type support
Date: Thu, 22 Mar 2012 08:00:57 -0400
To: bug-html-fillinform [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Download (untitled) / with headers
text/plain 216b
Show quoted text
> Hi. "Changes" file says new html5 input types are supported in > HTML::FillInForm 2.1, but apparently the feature is missing. Here's a > patch to fix and a test to confirm. Thanks.
Thank you, Kenichi. Mark
From: slobodan [...] miskovic.ca
any plans for applying the patch and releasing new version?
Download (untitled) / with headers
text/plain 339b
On Tue Jun 25 19:18:06 2013, slobo wrote: Show quoted text
> any plans for applying the patch and releasing new version?
Thanks for the nudge. Could you contribute a more complete patch which also updates docs and tests, preferably as a Github pull request? https://github.com/markstos/HTML-FillInForm I'm interested in getting this released. Mark
Download (untitled) / with headers
text/plain 460b
https://github.com/markstos/HTML-FillInForm/pull/1 On Mon Jul 01 22:41:39 2013, MARKSTOS wrote: Show quoted text
> On Tue Jun 25 19:18:06 2013, slobo wrote:
> > any plans for applying the patch and releasing new version?
> > Thanks for the nudge. Could you contribute a more complete patch which > also updates docs and tests, preferably as a Github pull request? > > https://github.com/markstos/HTML-FillInForm > > I'm interested in getting this released. > > Mark
Subject: Re: [rt.cpan.org #75933] new HTML5 input type support
Date: Tue, 02 Jul 2013 09:10:35 -0400
To: bug-html-fillinform [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Download (untitled) / with headers
text/plain 206b
Looks good. Github is Unicorning currently, but I've merged the patch and will try to get it released soon. In the meantime, you can use the patched version with confidence that it is forward-compatible.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.