[Catalyst] Recommend methods for form handling

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Fri Jan 19 17:29:58 GMT 2007







"Dami Laurent \(PJ\)" <laurent.dami at justice.ge.ch> wrote on 01/19/2007
10:37:20 AM:

> Jim Spath scribbled on 1/17/07 12:09 PM:
> > I was wondering what the current consensus among Catalyst users is
> > about what the best way to approach forms is?
> >
>
> I used FormBuilder for previous applications (and liked it a lot).
> But in our current project we need more dynamicity, so most form
> handling has moved to Javascript+Ajax :
>
>   - forms are generated by TT2 templates, but all fields are always empty
>   - when needed, new form subsections may be added dynamically
> through Jemplate
>   - all fields are named according to a dotted syntax (i.e.
> "mainObject.part.1.subpart.4.fieldName") that represents paths in a
> data tree of hashrefs and arrayrefs
>   - initialisation of the form is done in Javascript : the
> initializer receives a JSON data tree and fills the relevant fields
> (takes care of doing the appropriate action if the field is a
> textbox, a collection of radio buttons, a select , etc.)
>   - submission of the form is done through AJAX ; the server either
> returns OK or returns a tree of error messages, with the same paths
> as the data. In that case the Javascript code arranges to display
> errors next to the relevant portions of the page.
>
> On the perl side, the most relevant components in this process are
> TT2, CGI::Expand and Data::Domain.
> On the javascript side, we are building a form handling toolkit, on
> top of prototype.js. Not fully mature yet, but it should come out quite
soon.

These types of application decisions always make me ponder about javascript
going back into lockdown mode in large corporations.  You seem to be boxing
yourself into a corner if js filtering ever becomes back in trend.  Also
how are you handling accessibility -- or are users with special needs
considered expendable in your sector?  Most of (what I consider) to be sane
web2.0/ajax/js applications I see tend to build apps that are fully usable
without js, and then layer on js/ajax to make pieces of them more dynamic
or polish the UI. I am not ripping on this decision,  just asking if you
can go into your rational for this a little bit.

-Wade





More information about the Catalyst mailing list