sort of a form elements decorator... this has already been discussed here, I'm sure Massimo wouldn't mind to include a nice solution to this issue if someone has it. I too think there should be a way to customize form markup. It has already been suggested that form can be used for validation and its values can be used in a view with helpers to create custom markup.
On Apr 29, 1:35 pm, AchipA <attila.cs...@gmail.com> wrote: > 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---