#8 Generated ids contain whitespace

open
nobody
None
5
2003-03-29
2003-03-29
Stefan Schwarzer
No

In Field.MulticheckboxField %2i is used as placeholder.
This causes ids with single-digit integers to contain
whitespace.

Stefan

Discussion

  • Logged In: YES
    user_id=383516

    The new Field.MultiCheckboxField.htInputRender should be:

    def htInputRender(self, out, selections, default, options,
    nameMap=identity):
    id = 0
    for key, value in selections:
    id = id + 1
    out.write(html.input.checkbox(
    name=nameMap(self.name()),
    id="%s_%02i" % (nameMap(self.name()), id),
    value=self.encode(key),
    checked=self.selected(key, default) and
    "checked" or Exclude))
    out.write(html.label(
    " " + htmlEncode(value),
    for_="%s_%02i" % (nameMap(self.name()), id)))
    out.write(html.br())