[Israel.pm] Messing with Forms... Again...

Issac Goldstand margol at beamartyr.net
Mon Jan 12 03:03:49 PST 2004

You could look at something short 'n' sweet that I wrote during my "early"
Perl days...  It's CGI, but if you'd like I'm sure I could whip up a quick
mod_perl handler...  http://formfeeder.sourceforge.net/ (But sf.net is down
as I write this).


----- Original Message ----- 
From: "Yuval Yaari" <yuval at windax.com>
To: "Perl in Israel" <perl at perl.org.il>
Sent: Monday, January 12, 2004 11:17 AM
Subject: [Israel.pm] Messing with Forms... Again...

> Hi,
> Again, I'm trying to simplify the thing I hate most: handling forms.
> Usually the 3 steps occur:
> 1) Display the form
> 2) Check the submitted values.
>      if everything's ok, go to step 3, otherwise, go back to step 1 and
>      show the error.
> 3) Display a thank you message (or show the next part of the form...
> either way, that page will need access to the last POST data)
> I would like to simplify everything.
> As Pinkhas offered me, the forms won't contain _any_ form validation.
> The form validation will be done in mod_perl's handler subroutine.
> Then the validation function will either give an error (put it in the
> session, or using pnotes) and the autohandler of the forms will display
> it (so the forms won't contain any code, but the autohandler will) OR
> will redirect to the next page (either a thank you message or the next
> part of the form).
> This probably keeps everything clean(er).
> Now, since I am familiar with not-being-correct-about-field-names (the
> HTML coder uses FirstName and the Perl coder uses first_name etc)
> I would like to create some data-structure to keep this easy.
> Also this data strucute should keep some information about:
> * The form's next part (URI or something)
> * The form's validation function (subroutine reference, the params will
> be passed to it)
> * The form's "action" function (or maybe I should keep it inside the
> validation function?)
> I also have no idea what's the FORM's ACTION should be (since
> everything's done using the mod_perl handler subroutine).
> Any idea about how to implement everything would be appreciated.
> Anyone here ever created a big site and wants to share how he
> implemented forms handling?
>   --Yuval
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
> YAPC::Israel::2004
> http://www.perl.org.il/YAPC/2004/

More information about the Perl mailing list