Steve Knoblock (News Account) wrote:
Nate,
here is a page from our mockups of our admin forms. All PHP of course,
but you can look at the form.
http://www.folkstreams.net/mockup/film-facts.html
Another nice example. Like Jonas said, I thought I knew HTML. I must say
I see lots of potential use for that. I feel like a dummy for not using
those sooner.
Peter Eichman wrote:
Brainstorming off of your brainstroming:
I am assuming that if you listed a field name under the fields list in a
fieldset, you would not need to duplicate it in a separate top-level
fields list.
At first glance that seems reasonable, but then I can think of lots of
situations where I define excess defaults/etc and then use 'fields' to
control which ones are actually shown.
For example, check out this link and click on "Update it here!":
http://www.beerlabels.com/labels/beers.pl?brewco=Dogfish-Head-Craft-Brewery&id=189
The mysql table has a bunch of other fields, but since you're not logged
in as an admin, they are just popped off the fields list (despite a full
hash of %prev_defs being passed to 'defaults').
I'm wondering if the same could be done with 'fieldsets'. Maybe we
make it behave like validate/required:
- If fields is NOT specified, then fieldsets is taken as the list
- If fields IS specified, then it overrides fieldsets
Also, how should fields without an associated fieldset
behave in the presence of fieldsets? My inclination is to have them
lumped together at the end; i.e., the builtin $form->render method
would render the fieldsets first, then the "free-floating" fields.
I would tend to agree. We could place them in an unnamed fieldset at the
bottom (ie no <legend>).
How about also being able to give an optional prefix, to help
cut down on typing. Taking the shipping/billing address example:
CGI::FormBuilder->new(
fieldsets => {
saddr => {
legend => 'Shipping Address',
prefix => 'shipping_',
fields => [qw(street city state zip)],
},
Sounds cool, but I think at this point I want to resist too many more
niceties. The 3.x series has too many bugs, and I really want it to
stabilize. I think we should just spell that like this:
CGI::FormBuilder->new(
fieldsets => {
saddr => {
legend => 'Shipping Address',
fields => [ map { "shipping_$_" }
qw(street city state zip) ],
},
Technically that's less typing too. :-)
-Nate
|