# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1236887139 -3600 # Node ID c71997f514bad8cd4cac32d91f833b60095de212 # Parent 9e472941abd44167283dc458dc8e70f99721b8a8 fix password widget: do not duplicate dom id, fix confirm field name diff -r 9e472941abd4 -r c71997f514ba web/formwidgets.py --- a/web/formwidgets.py Thu Mar 12 20:45:13 2009 +0100 +++ b/web/formwidgets.py Thu Mar 12 20:45:39 2009 +0100 @@ -70,9 +70,11 @@ self.add_media(form) name, values, attrs = self._render_attrs(form, field) assert len(values) == 1 - inputs = [tags.input(name=name, value=values[0], type=self.type, **attrs), + id = attrs.pop('id') + confirmname = '%s-confirm:%s' % tuple(name.rsplit(':', 1)) + inputs = [tags.input(name=name, value=values[0], type=self.type, id=id, **attrs), '
', - tags.input(name=name+'-confirm', type=self.type, **attrs), + tags.input(name=confirmname, type=self.type, **attrs), ' ', tags.span(form.req._('confirm password'), **{'class': 'emphasis'})] return u'\n'.join(inputs)