1👍
✅
You should use attrs
parameter for form field widget like this:
from django.forms import TextInput
class CategoriesForm(ModelForm):
class Meta:
model = Categories
widgets = {
'category_name': TextInput(attrs={'placeholder': 'PLACEHOLDER TEXT HERE'})
}
0👍
In your forms.py you can write like this then it will show blur text in text box
first_name = forms.CharField(label=_('First Name'),max_length=30, required=True, widget=forms.TextInput(attrs={'placeholder':'Please Enter Your First Name'}))
- [Answer]-Django forms, specifying Model
- [Answer]-Django REST API pagination: always return the same data
Source:stackexchange.com