FAQ
I see that there are a number of form validation libraries that purport
to work with Catalyst. I've been using CGI::Formbuilder for years and
have been relatively happy with it.

I need something for my new Catalyst app. I have already created my
forms in my TT templates, but I need validation for most of the regular
stuff, including zip codes, states, credit card info, etc.

You guys got any recommendations?

Thanks.

Eric

Search Discussions

  • Octavian Rasnita at Nov 30, 2010 at 6:16 am
    HTML::FormFu and also:
    Catalyst::Controller::HTML::FormFu
    HTML::FormFu::Model::DBIC

    Octavian

    ----- Original Message -----
    From: "Eric Berg" <[email protected]>
    To: <[email protected]>
    Sent: Tuesday, November 30, 2010 5:34 AM
    Subject: [Catalyst] Which Form Validation Libs?

    I see that there are a number of form validation libraries that purport
    to work with Catalyst. I've been using CGI::Formbuilder for years and
    have been relatively happy with it.

    I need something for my new Catalyst app. I have already created my
    forms in my TT templates, but I need validation for most of the regular
    stuff, including zip codes, states, credit card info, etc.

    You guys got any recommendations?

    Thanks.

    Eric

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/
  • Darren Duncan at Nov 30, 2010 at 7:52 am

    Eric Berg wrote:
    I see that there are a number of form validation libraries that purport
    to work with Catalyst. I've been using CGI::Formbuilder for years and
    have been relatively happy with it.

    I need something for my new Catalyst app. I have already created my
    forms in my TT templates, but I need validation for most of the regular
    stuff, including zip codes, states, credit card info, etc.

    You guys got any recommendations?

    Thanks.

    Eric
    Its not form specific, but currently I like using MooseX::Types and
    MooseX::Types::Structured for validation.

    You can use these to declare validators in a declarational fashion for each data
    type you have, or use pre-defined ones for some common cases. For each type
    Foo, it provides an is_Foo function you can test inputs with.

    With MooseX::Types::Structured in particular and its "Dict" type constructors,
    you can define a type to represent the form as a whole, so it will check you
    have all the right fields and their contents; that said, while using a "Dict"
    for the whole form will tell you if any field was done incorrectly, it alone
    won't say which field, so whether you might want to use it depends on how
    specific you want input error messages to be.

    -- Darren Duncan
  • Mike Raynham at Nov 30, 2010 at 8:24 am

    On 30/11/10 03:34, Eric Berg wrote:
    I see that there are a number of form validation libraries that purport
    to work with Catalyst. I've been using CGI::Formbuilder for years and
    have been relatively happy with it.

    I need something for my new Catalyst app. I have already created my
    forms in my TT templates, but I need validation for most of the regular
    stuff, including zip codes, states, credit card info, etc.

    You guys got any recommendations?

    Thanks.

    Eric

    I have just started to look at Data::FormValidator:

    "Data::FormValidator lets you define profiles which declare the required
    and optional fields and any constraints they might have."

    You can use the built-in constraints, use existing CPAN modules (e.g.,
    Email::Valid), and add your own custom constraints - maybe incorporating
    MooseX::Types and MooseX::Types::Structured, as suggested by Darren Duncan.

    It doesn't generate form HTML for you, but I prefer to manually create
    this anyway.


    Regards,

    Mike
  • David Schmidt at Nov 30, 2010 at 9:31 am
    another great module which from my perception is used the most lately is

    HTML::FormHandler
    http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/

    greetings
    david

    On Tue, Nov 30, 2010 at 9:24 AM, Mike Raynham
    wrote:
    On 30/11/10 03:34, Eric Berg wrote:

    I see that there are a number of form validation libraries that purport
    to work with Catalyst. I've been using CGI::Formbuilder for years and
    have been relatively happy with it.

    I need something for my new Catalyst app. I have already created my
    forms in my TT templates, but I need validation for most of the regular
    stuff, including zip codes, states, credit card info, etc.

    You guys got any recommendations?

    Thanks.

    Eric

    I have just started to look at Data::FormValidator:

    "Data::FormValidator lets you define profiles which declare the required and
    optional fields and any constraints they might have."

    You can use the built-in constraints, use existing CPAN modules (e.g.,
    Email::Valid), and add your own custom constraints - maybe incorporating
    MooseX::Types and MooseX::Types::Structured, as suggested by Darren Duncan.

    It doesn't generate form HTML for you, but I prefer to manually create this
    anyway.


    Regards,

    Mike

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/
  • Shlomi Fish at Nov 30, 2010 at 11:26 am

    On Tuesday 30 November 2010 11:31:56 David Schmidt wrote:
    another great module which from my perception is used the most lately is

    HTML::FormHandler
    http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/
    I can recommend *against* HTML-FormHandler.

    For my day job's Perl and Catalyst project, we initially decided to go with
    HTML-FormHandler, only to discover it was buggy, quirky and had severe memory
    leaks. We ended up doing many workarounds and recently made a transition from
    it to HTML-FormFu, which while by no means perfect, is much saner.

    My co-worker "nothingmuch" who has done many of the workarounds can provide
    further comments on it. Recently I had to over-ride a role in the login form
    (for which we need to use HTML-FormHandler due to CatalystX::SimpleLogin) that
    will accept an empty string as the 'action=""' attribute because it only
    placed true values of the attribute there, which ruled out empty strings. But
    I recall many other fun hours debugging HTML-FormHandler.

    Stay away if you can.

    Regards,

    Shlomi Fish

    --
    -----------------------------------------------------------------
    Shlomi Fish http://www.shlomifish.org/
    What does "Zionism" mean? - http://shlom.in/def-zionism

    <rindolf> She's a hot chick. But she smokes.
    <go|dfish> She can smoke as long as she's smokin'.

    Please reply to list if it's a mailing list post - http://shlom.in/reply .
  • Hernan Lopes at Nov 30, 2010 at 12:13 pm
    formhandler and formbuilder have some syntax similarities. shouldnt be hard
    to move from one to the other.
    Just in case you are curiousm, here are some examples:
    FormBuilder: http://www.formbuilder.org/tutor/index.pl?c=1&s=5
    FormHandler:
    http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/lib/HTML/FormHandler/Manual/Catalyst.pod

    --Hernan
    On Tue, Nov 30, 2010 at 9:26 AM, Shlomi Fish wrote:
    On Tuesday 30 November 2010 11:31:56 David Schmidt wrote:
    another great module which from my perception is used the most lately is

    HTML::FormHandler
    http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/<http://search.cpan.org/%7Egshank/HTML-FormHandler-0.32005/>
    I can recommend *against* HTML-FormHandler.

    For my day job's Perl and Catalyst project, we initially decided to go with
    HTML-FormHandler, only to discover it was buggy, quirky and had severe
    memory
    leaks. We ended up doing many workarounds and recently made a transition
    from
    it to HTML-FormFu, which while by no means perfect, is much saner.

    My co-worker "nothingmuch" who has done many of the workarounds can provide
    further comments on it. Recently I had to over-ride a role in the login
    form
    (for which we need to use HTML-FormHandler due to CatalystX::SimpleLogin)
    that
    will accept an empty string as the 'action=""' attribute because it only
    placed true values of the attribute there, which ruled out empty strings.
    But
    I recall many other fun hours debugging HTML-FormHandler.

    Stay away if you can.

    Regards,

    Shlomi Fish

    --
    -----------------------------------------------------------------
    Shlomi Fish http://www.shlomifish.org/
    What does "Zionism" mean? - http://shlom.in/def-zionism

    <rindolf> She's a hot chick. But she smokes.
    <go|dfish> She can smoke as long as she's smokin'.

    Please reply to list if it's a mailing list post - http://shlom.in/reply .

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20101130/f5f0c234/attachment.htm
  • Ashley Pond V at Nov 30, 2010 at 2:47 pm
    HTML::FormHandler
    Chiming in: FormHandler has been getting the most questions lately,
    IIRC, but I suspect FormFu is more often used. It has its own
    excellent mailing list (made excellent by the main dev, Carl Franks,
    who is very responsive and helpful) so the questions don't tend to end
    up here. Except for speed (it's quite slow) I like it very well and it
    has excellent hooks/extensions for DBIC.
  • Steve at Nov 30, 2010 at 3:49 pm
    My guess is that FormHandler is getting the attention that it is is due
    to two major things. First of all, it is Moose based - like Catalyst.
    Secondly, the documentation of FormHandler seems more complete. Unless
    the docs for FormFu have been updated recently (past 6 months or so),
    the author acknowledges this fact about the documentation.
    On 11/30/2010 9:47 AM, Ashley Pond V wrote:
    HTML::FormHandler
    Chiming in: FormHandler has been getting the most questions lately,
    IIRC, but I suspect FormFu is more often used. It has its own
    excellent mailing list (made excellent by the main dev, Carl Franks,
    who is very responsive and helpful) so the questions don't tend to end
    up here. Except for speed (it's quite slow) I like it very well and it
    has excellent hooks/extensions for DBIC.

    _______________________________________________
    List: [email protected]
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/[email protected]/
    Dev site: http://dev.catalyst.perl.org/
  • Toby Corkindale at Dec 7, 2010 at 4:02 am

    On 30 November 2010 22:26, Shlomi Fish wrote:
    On Tuesday 30 November 2010 11:31:56 David Schmidt wrote:
    another great module which from my perception is used the most lately is

    HTML::FormHandler
    http://search.cpan.org/~gshank/HTML-FormHandler-0.32005/
    I can recommend *against* HTML-FormHandler.

    For my day job's Perl and Catalyst project, we initially decided to go with
    HTML-FormHandler, only to discover it was buggy, quirky and had severe memory
    leaks. We ended up doing many workarounds and recently made a transition from
    it to HTML-FormFu, which while by no means perfect, is much saner.

    My co-worker "nothingmuch" who has done many of the workarounds can provide
    further comments on it. Recently I had to over-ride a role in the login form
    (for which we need to use HTML-FormHandler due to CatalystX::SimpleLogin) that
    will accept an empty string as the 'action=""' attribute because it only
    placed true values of the attribute there, which ruled out empty strings. But
    I recall many other fun hours debugging HTML-FormHandler.
    I hit issues with FormHandler and HFH::Model::DBIC having issues with
    empty strings vs definedness too, but it was a few months ago. I
    submitted some patches that were accepted a few versions back and it's
    been pretty good for me since. The code is reasonably logical and easy
    to work with, I felt.

    By comparison, a major app I built on FormFu earlier in the year
    resulted in epic debugging and terribly complex and not-at-all-logical
    forms, and the problems seemed more deeply ingrained. (That was a
    medium version number at least ago.)

    They both have their weaknesses, but having used both, I definitely
    think HFH is the way to go at the moment.

    Both modules have good authors who are helpful and actively developing.

    Cheers,
    Toby
  • Peter Karman at Nov 30, 2010 at 3:01 pm

    Eric Berg wrote on 11/29/2010 09:34 PM:

    You guys got any recommendations?
    Rose::HTML::Objects

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedNov 30, '10 at 3:34a
activeDec 7, '10 at 4:02a
posts11
users11
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2023 Grokbase