I have a specific field in a form which needs to have a custom attribute AND we styled as a password box. Currently I have:
login_password = forms.CharField(label=(u'password'))
But I need both of these:
widget=forms.TextInput(attrs={'placeholder': 'password'})
widget=forms.PasswordInput(render_value=False)
How can I make it so the field uses these two widgets? I've read about MultiWidget but I'm not sure if this is what I need to use or how exactly to use it.
PasswordInput accepts attrs as well.
login_password = forms.CharField(label=u'password', widget=forms.PasswordInput(render_value=False, attrs={'placeholder': 'password'}))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With