I've been customizing some forms that needed to be editable by a
designer - we ended up having something I would call 'formify', at
least for the time of the development cycle. What's the idea here you
ask ? Imagine the following:

form=FORM(SELECT(...), INPUT(..), INPUT(...))

Now, this all nice but the layout either needs to be danced around
with css funk (can get messy if the field ordering needs to change,
etc) or with addressing form list elements from python in the view
(even worse).

However, what if we could say to our friendly designer - make the form
look whatever you want it to look, as long as you keep the specified
identifiers for the form fields. Then, we skip {{=form}} since it's
already there in html, and at the end of the view, we hop in with

{{=formify(form)}}

which will generate JS code that actually replaces/rewrites the
elements in the form with the ones in the 'form' var (based on their
id/names) while keeping the original (designer specified) attributes
of the elements.

Well, it took almost as much to write this post as to code my stopgap
solution (I'm not posting it here as it's very implementation
specific), but still, I'm curious about your thoughts about making
form design easier - this solution or other.

PS. And yes, this is backwards compatible :)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to