Skip to content
Advertisement

Django form – set label

I have a form that inherits from 2 other forms. In my form, I want to change the label of a field that was defined in one of the parent forms. Does anyone know how this can be done?

I’m trying to do it in my __init__, but it throws an error saying that “‘RegistrationFormTOS’ object has no attribute ’email'”. Does anyone know how I can do this?

Thanks.

Here is my form code:

JavaScript

Advertisement

Answer

You should use:

JavaScript

Note first you should use the super call.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement