Avoid duplicating form input element id in Django

If two forms on the same page have the same field, Django will generate invalid HTML:

<!--one form --> <input id="id_name"..../> ... <!--another form--> <input id="id_name".../> 

This is not true because two or more nodes have the same identifier.

How can this be avoided?

Thanks.

+7
html django forms
source share
1 answer

You need to use the form prefix as described here .

+14
source share

All Articles