Ticket #19874: widgets-add_id_to_CheckboxSelectMultiple.patch

File widgets-add_id_to_CheckboxSelectMultiple.patch, 580 bytes (added by l3on, 3 years ago)

add id to CheckboxSelectMultiple

  • widgets.

    old new  
    684684        if value is None: value = []
    685685        final_attrs = self.build_attrs(attrs, name=name)
    686686        id_ = final_attrs.get('id', None)
    687         output = ['<ul>']
     687        if id_:
     688            output = ['<ul id="%s">' % id_]
     689        else:
     690            output = ['<ul>']
    688691        # Normalize to strings
    689692        str_values = set([force_text(v) for v in value])
    690693        for i, (option_value, option_label) in enumerate(chain(self.choices, choices)):
Back to Top