My comment will likely be more consoling than useful: I've been writing CGI constantly for 10 years and I have never solved this problem in a way I find satisfactory. The client side is a great place for it because it's fast, flashy, and saves server load. The server side is necessary because user input can't be trusted. The presentation/view has to carry feedback; maybe in more than one dialect (XHTML/JSON). The model must be respected (built-in constraints) and the business side of the model must be protected and both will be used is a disconnected from the view/controller fashion so it might end up carrying its own layer. Now we're up to at least three points of validation + exception and feedback handling and let's not even speak of il8n.

If this were solved right... it would be in a fat model (business logic/constraints built into the model interaction) which exported information and exceptions thoroughly enough to automate the control and view layers completely. There are two points here, there must be a "validate" method in addition to a "create/update" method. I suppose in DBIC parlance, Result->new() would do validation/checking while Result->create_or_update would do that after passing the validation checks in ->new. You see a problem immediately though. Your framework is now married to a model class. FormFu has made some strides here. I've adopted it lately and I'm not sorry yet. Still, it's not hitting the sweet spot that makes me feel like the search is over.


In reply to Re: HTML forms ... "whew!" Advice? by Your Mother
in thread HTML forms ... "whew!" Advice? by locked_user sundialsvc4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.