Django form sets placeholder to CharField instead of value

I suppose I have the following simple form:

class UserForm(Form):
    first_name = CharField(label='First Name')
    last_name = CharField(label='Last Name')
class UserForm(Form): first_name = CharField(label='First Name') last_name = CharField(label='Last Name')

There is also some custom validation.

When user sends invalid data, Django displays form with invalid values in fields.

Is it possible to display empty CharFields, but with placeholders that show the data entered?

Вернуться на верх