Wednesday, July 26, 2017

Re: Is there a way to use input text placeholder when using {{ form.as_p }}

in the init method of your form do something like this:

self.fields['verification_date'].widget.attrs["placeholder"] = 'date'

> On Jul 26, 2017, at 1:31 PM, Alexander Joseph <alexander.v.joseph@gmail.com> wrote:
>
> I'm using {{ form.as_p }} in my template and would like to be able to use placeholders in the individual input fields. Is there a way to do this? Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/24FEB5E0-92C9-4824-9BDD-82047D6D0AD9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment