FAQ
i can't get Plugin::FillInForm to work. i've found why it's failing
but not how to fix it.

before fillinform is called, the page source contains input tags like
this:

<input value="" name="login" id="login" type="NOT_BLANK" />

the NOT_BLANK property is coming from some part of the app, not from
my template, and it's causing HTML::FillInForm to ignore the input
control (see below for example code to prove this). my guess is that
the "NOT_BLANK" comes from Plugin::FormValidator::Simple, but i've
followed the examples exactly:

$c->form(
firstname => [qw/ NOT_BLANK ASCII /, [ qw/ LENGTH 1 32 /]],
lastname => [qw/ NOT_BLANK ASCII /, [ qw/ LENGTH 1 32 /]],
);

i've even removed the 'firstname' option from the form entirely, and
i'm still getting "NOT_BLANK" in the output. i'm totally puzzled.

if it's helpful, i've also included my 'use' and 'config' statements
from the root package. thanks in advance for any help.

randall

----
this code spits out a control with no value and a "NOT_BLANK" type.
remove the 'type' property and it works as expected.

#!/usr/bin/perl
use CGI;
use HTML::FillInForm;

my $q = new CGI;
$q->param( 'firstname', 'joe' );
print HTML::FillInForm->new->fill(
fobject => $q,
scalarref => \'<input name="firstname" type="NOT_BLANK" />',
);

----

use Catalyst qw/
-Debug
Authentication::CDBI
FormValidator::Simple
FillInForm
Session::FastMmap
/;

__PACKAGE__->config({
form_method => 'post',
authentication => {
name => 'GoBiodiesel',
user_class => 'GoBiodiesel::Model::CDBI::User',
user_field => 'login',
password_field => 'password',
password_hash => '',
},
validator => {
plugins => [ qw/ CDBI::Unique /],
messages => __PACKAGE__->path_to( qw/ root error_messages.yaml /),
options => {
cdbi_base_class => 'GoBiodiesel::Model::CDBI',
},
},
'View::MyView' => {
INCLUDE_PATH => [ __PACKAGE__->path_to( qw/ root templates /)],
CATALYST_VAR => 'GB',
WRAPPER => 'global/wrapper.tt',
PRE_PROCESS => 'global/startup.tt',
TEMPLATE_EXTENSION => '.tt',
},
});
__PACKAGE__->setup;

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 19, '05 at 5:08a
activeDec 19, '05 at 5:08a
posts1
users1
websitecatalystframework.org
irc#catalyst

1 user in discussion

Randall Hansen: 1 post

People

Translate

site design / logo © 2023 Grokbase