You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Aaron Johnson <so...@gina.net> on 2000/07/28 18:08:56 UTC

Form Filling - was Re: Templating System

There is the HTML::FillInForm module that will pre fill your forms.
It is pure Perl.  It seems to work well, haven't stress tested it yet.

I am using it in conjunction with Apache::ASP, but haven't hacked
the Apache::ASP module to include it as a function.  It is much easier
to work with now that Joshua has added the $Response->TrapInclude
function (thank you).  I just keep my form in an include file, read it in to
my script/page
with the $Response->TrapInclude then send the it through HTML::FillInForm
with my values I want in the form.

This is all it takes -
use HTML::FillInForm;

my $fif = new HTML::FillInForm;

my $html = $Response->TrapInclude('dbd_form.inc');

my $output = $fif->fill(scalarref => $html,
                  fdat => \%form_content);

print "$output";

(note the %form_content is defined previously and contains the from elements
names
as the keys and then the "default" value as the value.)

As far as templating systems go there is NO Perl or "funky" HTML in any of
the forms.

Of course this behavior is built-in and handled extremely nicely in
HTML::Embperl, as far as handling and working with HTML I find HTML::Embperl
to be the most powerful of the ones available.

Drew Taylor wrote:

> Joshua Chamas wrote:
> >
> > I'll be bringing auto formfilling to the Apache::ASP table
> > just as soon as I work out the details with other interested
> > parties.  I'm thinking of some kind of $Response->{FormFill}
> > attribute, and possibly a FormFill config setting, to specify
> > runtime form filling, then there's that whole ASP+ syntax
> > to possibly support as well.
> That would be most excellent! I have yet to take more than a cursory
> look at Apache::ASP and Embperl, so I don't know what feature set they
> offer. I think the thing that is most difficult to currently do in my
> modules is the form pre-filling.
>
> In my case, it is imperative to save all input that the user entered,
> except for fields incorrectly entered or missing. I currently do it my
> grabbing form input, do some basic checking for each group of info, save
> it to the DB, and then display either for form again with the
> missing/error fields highlighted or show a response.
>
> Anything that would make the above scenario easier would get a thorough
> look in future templating system decisions. In short, I'm looking for a
> good, FLEXIBLE application framework. I'm tired of writing it all
> myself. And while it has been excellent experience, I say build on the
> backs of other giants. :-)
>
> I spent the first 1.5 hours today reading all the threads of "templating
> system", and it was worth every second. :-) IMHO, the lack of a
> "standard" framework is the perl community's biggest drawback. But then
> we also have many systems to choose from, so that is a big benefit. As
> someone else mentioned, interoperability, even in just it's a most basic
> form, would be a major feature.
>
> Oh yeah, and throw in a CMS to boot ;-) Keep up the _excellent_ work
> folks.
>
> --
> Drew Taylor
> Vialogix Communications, Inc.
> 501 N. College Street
> Charlotte, NC 28202
> 704 370 0550
> http://www.vialogix.com/