The Bull Og

Onine since 1994. Offline since 1976.

See also the archive

An individual post follows.

In these last two weeks, I've made a lot of progress in migrating a monolithic form into AJAXian formlets. I discovered FormBuilder and was ecstatic about the client- and server-side validation and that was the crux of the transition.

It was going smoothly; too smoothly as a matter of fact. I had a single controller to handle requests like 'forms/FORM_ID' and serve up the proper form (based on FORM_ID,) the controller was handling POST-backs and doing updates (based on FORM_ID,) and I was returning JSON to indicate success or failure. Everything was going great until I realized that I couldn't get a hook into the server-side validation which I need to be more robust than just some pattern checking.

I had gone too far down the path of dynamic form generation to turn back and I was about to tear-up when I remembered having taking a look at HTML::FormFu a while back. Looking into the documentation, I found a potential solution to my problem of custom server-side validation. I only dreaded having to swap out FormBuilder for HTML::FormFu.

I'm glad to report that two hours into the endeavor, the conversion is going magnificently. I'm refactoring the ".fb" files as ".yml" files but aside from that, there's not much change to my controller for handling forms. There are a couple of syntactical differences here and there but for the most part, it's painless.