a11y: add title attribute to asterisk marking required fields (#34736)

This commit is contained in:
Frédéric Péters 2019-07-10 16:05:56 +02:00
parent 41515156ce
commit 4e6f1778d2
1 changed files with 2 additions and 1 deletions

View File

@ -99,7 +99,8 @@ def is_prefilled(self):
def render_title(self, title):
if title:
if self.required:
title += htmltext('<span class="required">*</span>')
title += htmltext('<span title="%s" class="required">*</span>') % _(
'This field is required.')
return htmltext('<div class="title"><label for="form_%s">%s</label></div>') % (
self.name, title)
else: