6👍
✅
Have you tried this:
email = forms.EmailField(
widget = forms.TextInput(attrs={'placeholder': 'Email', 'class': 'myClass', 'size': 'mySize'}))
This is normal Python syntax (inside the curly braces is a dict and a dict can have unlimited entries), and I don’t know, why it should not work.
Normally, when you have an API, where a dict is required, that is a clear sign, that multiple values are possible.
1👍
email = forms.EmailField(
widget = forms.TextInput(attrs={‘placeholder’: ‘Email’, ‘class’: ‘myClass’, ‘onkeyup’:’get code();’}))
- [Django]-Django Authenticate Backend Multiple Databases
- [Django]-Registration form with profile's field
- [Django]-Django – Models – Recursively retrieve parents of a leaf node
- [Django]-How to truncate content for Mdeditor (content as markdownx) – Django
Source:stackexchange.com