class LoginForm(forms.Form):
    username = forms.CharField(
        label="Email or Username",
        widget=forms.TextInput(
            attrs={
                "class": "fas fa-user",
                "placeholder": "f007 Username or Email",
            }
        ),
    ) the class is not showing up but the placeholder shows up without the
f007
On Tue, Jun 15, 2021 at 10:04 AM Williams Andy Inc <swissno...@gmail.com>
wrote:

> Thanks am already trying that,   and using that works for
> adding placeholder, but then it doesn't add a class,  if it could add i
> class i could use the font awesome unicode which would have been the
> easiest solution.
>
> On Tue, Jun 15, 2021 at 9:53 AM Lalit Suthar <sutharlalit...@gmail.com>
> wrote:
>
>> you can try if it can be done with widgets I am not sure
>> https://docs.djangoproject.com/en/2.2/ref/forms/widgets/
>>
>> On Tue, 15 Jun 2021 at 11:24, Williams Andy Inc <swissno...@gmail.com>
>> wrote:
>>
>>> I would like to know is there any easier way rather than overriding
>>> super, how do i add icons into the html input eg to have a key icon on the
>>> password field
>>>
>>> without installing any third party app also.
>>>
>>> is the best solution to render form in html and pass field values to
>>> django? or is there anyway to manipulate django and insert a text between
>>> input
>>>
>>>
>>> django has this
>>> <input type="email" name="email" maxlength="60" required=""
>>> id="id_email">
>>>
>>>
>>> i want to have this
>>> <input type="email" name="email" maxlength="60" required=""
>>> id="id_email" <i class="far fa-thumbs-down"></i>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/946421cf-4abf-45cd-b40c-f3639203b43bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAGp2JVHRMgxFF9km7%3D5eQP8wDi3ePuOveyN3vkjJj1hRL0BVJA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCthN%2BOcUujz0BV2RbgC5a%3DDc4YY%3D4H3HOPpW%3DcpOshNvLYuA%40mail.gmail.com.

Reply via email to