[Erp5-dev] patch for xhtml - mark changed fields

bartek bartek at erp5.pl
Thu Mar 29 13:57:31 CEST 2007


Hi

This is a proposed patch for erp5_xhtml/field_render - it highlights 
changed fields, so that the user is aware that the form contains unsaved 
changes.

Would that be ok? (yes, the color should be in css, but apart from that?).

Bartek

Index: field_render.xml
===================================================================
--- field_render.xml    (wersja 13116)
+++ field_render.xml    (kopia robocza)
@@ -89,7 +89,9 @@
      <div tal:define="html_render  python: field.render_htmlgrid(value, 
request)"\n
           tal:attributes="title field_description;\n
                           class python: \' \'.join([x for x in 
[\'field\', field.is_required() and \'required\' or None, 
field_has_error and \'error\' or None, field.get_value(\'css_class\') or 
None] if x is not None])"\n
-         i18n:attributes="title" i18n:domain="ui">\n
+         i18n:attributes="title" i18n:domain="ui"\n
+          onchange="event.target.style.backgroundColor=\'yellow\';"\n
+         >\n
        <tal:block tal:repeat="html_tuple html_render">\n
          <label>\n
            <tal:block tal:content="structure python: html_tuple[0]"\n






More information about the Erp5-dev mailing list