Skip to content


Form.Radio: render gives duplicate IDs to the generated <inputs> #181

nick-danger opened this Issue · 0 comments

1 participant


The Radio class's render method in Form uses the same ID value in each tag it generates. A cheap fix is to insert one line at or about line 307 of, thusly:

            attrs['type'] = 'radio'
            attrs['value'] = value
            attrs['id'] += '-'+value    # <-- inserted line
            if self.value == value:
                attrs['checked'] = 'checked'

Obviously, it would be better to do some sort of cleansing of the 'value' being appended to the ID to ensure it doesn't contain illegal characters. I'd have done that, but I'm not quite up to speed with the 'zen' of yet. Suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.