Hi all:

I've stumbled across something I can't find relevant documentation for, so
I'm hoping someone can help me with this.

I've got several complex forms (when I say "complex", I guess I mean that
they deal with groups of related items - for example, I have a list of
schools that someone will have attended, where for each entry there's the
name of the school, the level at which the education is being conducted
(university, high/secondary school, etc.), start and end dates, and so on.
Basically, I'm using variable_decode() a lot to group items together).

Each form lists all of the existing entries for a given type of data (such
as a spell in a school/university as described above) in tabular form, and
leaves a blank set of fields at the bottom for users to add another row to
the table, so to speak. There are two different submit buttons for the form;
one deletes any entries where the related checkbox is ticked, and the other
saves any updates to the database.

The big thing I want to do is something pretty fundamental, really - in the
event that the validation fails, or if someone deletes an entry having made
changes to another, that the form comes back to the user with his/her
unsaved changes intact. I've looked at formhelpers, which doesn't look like
it plays nice with forms that don't have a fixed number of fields, and
htmlfill looks promising, but I can't quite see how exactly I'm supposed to
do what I need in this instance - I've got the added gotcha that the dict
returned by variable_decode can be a couple of levels deep - for example,
the validation for the start and end dates I described above includes a
check to see if the start date is before the end date, and this is separate
to the body of the main "row" validator, so I can end up with
form_result['entry'][0]['date']['start'] or some such in the form_result
dictionary from FormEncode.

If anyone could recommend an approach to take on this, or perhaps provide
some sample code, it'd be great.
Thanks,
Domhnall.

-- 
Quidquid latine dictum sit, altum sonatur.
(Whatever is said in Latin sounds profound)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to