widget attrs doesn't work
captcha = CaptchaField(error_messages={ widget=CaptchaTextInput(attrs={'placeholder': message})) the placeholder doesn't work
@ziima this might be in the realm of your recent changes, what is your take on this?
I just want add a placeholder at the captcha field
captcha = CaptchaField(error_messages={'invalid': e_message}, widget=CaptchaTextInput(attrs={'placeholder': p_message}, output_format=u'%(hidden_field)s %(text_field)s %(image)s'))
the output_format is ok, but the placeholder doesn't work
Using django-simple-captcha 0.5.7, django 1.11 and python 2.7 following works for me:
from django import forms
from captcha.fields import CaptchaField, CaptchaTextInput
class MyForm(forms.Form):
captcha = CaptchaField(widget=CaptchaTextInput(attrs={'placeholder': 'SMEGHEAD!'}))
form = MyForm()
unicode(form)
@shuai336 ~~I'm not entirely sure how your form looks like, but~~ output_format is now deprecated in favor of template based rendering. One of the reasons was to fix the behavior of widget attributes. Edit: I got it, once I submitted the comment.