[Catalyst] Handling add/edit screens
Bill Moseley
moseley at hank.org
Tue Mar 14 16:12:01 CET 2006
On Mon, Mar 13, 2006 at 11:27:01PM -0500, moltar wrote:
> This is a very common scenario. First you have a form to add a record,
> and then later you want to edit the record. Sometimes the records is
> *almost* the same, but not quite.
>
> For example, editing a user profile - users must provide a username when
> registering, but can't change it on the edit screen. Also while editing
> user profile, they must provide an old password and a new one twice. But
> the rest of the form (name, email, address, etc...) is exactly the same.
Mostly my create and update forms are the same.
When they vary a little I put some logic in the template. But more
often than not when going down that path I end up using two different
templates. (Yesterday I did this as I was trying to use the same
form template for both "Signup" and "Edit Your Profile" pages.
For common field groups I put them in their own file and include them.
Then using separate forms for different actions doesn't seem so
redundant.
> I am using FormValidator::Simple.
Check out HTML::Rose::Objects before you get too far into your
project.
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list