On Mon, Jan 19, 2009 at 7:39 AM, Josh Winslow <[email protected]> wrote: > > Is there anyway to output forms fields without the table structure? > Right now when I do this: > > <snipping leading template stuff> > > ${h.field( > "Document Title", > h.text(name='title'), > required=True > )}
The field helper was added to WebHelpers 0.6.3 as an experimental module, and was removed in WebHelpers 0.6.4 for being insufficiently robust. There is no consensus on the best way to lay out form fields. Tables are evil but divs have browser-specific issues. And I can't properly set <label for=> because field() doesn't know what text()'s ID is unless it's specified redundantly, and making field() call text() turns out to be just as problematic, and parsing text()'s output is even worse, etc. Templates work better for field layout than WebHelpers can hope to do. So in the end I made a less ambitions helper, title() (in webhelpers.html.tags), which does part of the layout (placing the field title in required or not-required style), and just punts on the ID issue by taking a ``label_for`` argument. This should work under all layout strategies. There's another field() in the Pylons book. That one was originally intended for WebHelpers but ended up in a separate package instead, FormBuild. -- Mike Orr <[email protected]> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
