Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Initial Version and Version 5 of Ticket #1914

08/27/08 18:15:37 (11 years ago)
Chris Arndt

Ok, now I see the error. I think your patch for forms.py is sensible and corresponds with the templates of the TableForm and ListForm templates, which also use py:replace for displaying the form field widgets. RepeatingFieldSet needs this change as well.

I don't think we should change the CalendarDatePicker template, though, because:

  1. It is not necessary to get the output validated after the template of FieldSet etc. is changed.
  2. It would be too complicated to apply CSS styling to all elements that make up the calendar widget without an enclosing element.
  3. The other big widgets (e.g. AutoCompleteField, AutoCompleteTextField, etc.) have an enclosing DIV element too.

On the other hand, the enclosing DIVs do not have any class or id attribute at the moment and so are hard to target with CSS rules. The DIVs are probably there because having py:strip on the root element did not work in earlier Kid versions. So maybe we should strip them from all big widgets or change them into SPAN elements with a proper class, so they can be targeted with CSS rules (and, for example, get a display: block style if necessary, so they act like DIV elements).

Anyway, these changes will go into the 1.1 branch only, because changing the element hierarchy of the HTML output of widgets may break the page layout of existing applications.


  • Ticket #1914

    • Property Owner changed from anonymous to Chris Arndt
    • Property Status changed from new to assigned
    • Property Summary changed from Improper span div nesting in forms to Improper SPAN/DIV nesting in FieldSet widgets
    • Property Milestone changed from to 1.1
  • Ticket #1914 – Description

    initial v5  
    1 Some form widgets produce unnecessary span or div tags.  Since a span should not directly contain a div this can result in invalid HTML.  I've corrected the FieldSet and CalendarDatePicker templates. 
     1Some form widgets produce unnecessary DIV elements. Since a span should not directly contain a div and the !FieldSet widget wraps form filed widgets in a a SPAN element this can result in invalid HTML.   
     3I've corrected the FieldSet and CalendarDatePicker templates.