FAQ
I kind of figure it out by myself. It seems that I can't return to its
original url with "action" when I use the post method.

Cheers all.


2013/3/21 Logust Yu <logust79@googlemail.com>
Hello,

I've tried Formbuilder with Apache and had no problem with that. But when
I use Formbuilder with Dancer, I have to deliberately set a value to
"action", otherwise it will go to a blank page. But this trick only works
when the method within the formbuilder section is "get". If I change it to
"post", it again goes to a blank page.

Is there anything I can do to mend this?

Many thanks!

L

get '/' => sub {
my @fields = qw(Username Password);

my $form = CGI::FormBuilder->new(
method => 'post',
fields => \@fields,
action => '/',
required => 'ALL',
);
$form->field(name => 'Password',
type => 'password',
);

if ($form->submitted && $form->validate) {
# you would write code here to act on the form data
my $username = $form->field('Username');
my $password = $form->field('Password');

.......
} else {
return $form->render;
}
};
dance;

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedMar 21, '13 at 7:58p
activeMar 21, '13 at 9:27p
posts2
users1
websiteperl.org

1 user in discussion

Logust Yu: 2 posts

People

Translate

site design / logo © 2022 Grokbase