shaoyh/django-simple-captcha

CSS class to the widget

Opened this issue · 3 comments

How to add CSS class to the widget input code
Example:
captcha = CaptchaField (label = _ ('code'), widget = CaptchaTextInput(('class': 
'registertext1')))

Original issue reported on code.google.com by gandriyk...@gmail.com on 6 Oct 2010 at 9:04

Hello, 
thank you for this, I'm unsure on whether this is a bug report or rather a code 
snippet which you would like to share with the community.

If this is actually a bug report, could you please elaborate on what you're 
expecting django-simple-captcha to do?

Original comment by mbonetti on 6 Oct 2010 at 1:12

This html of standard render field captcha.
<img src="/captcha/image/ccbbcbf31837a16ef36e95ee0284a540c061938c/" 
alt="captcha" class="captcha" /> 
<input type="hidden" name="captcha_0" 
value="ccbbcbf31837a16ef36e95ee0284a540c061938c" id="id_captcha_0" />

I want add class "CLASS_NAME" to input like this:
<input type="hidden" CLASS="CLASS_NAME" name="captcha_0" 
value="ccbbcbf31837a16ef36e95ee0284a540c061938c" id="id_captcha_0" />

Original comment by gandriyk...@gmail.com on 6 Oct 2010 at 7:04

Hi,
I encountered the same issue. access to the widget is effectively disabled.
There is no way to initialize the widget manually nor to pass parameters for 
it's initialization when constructing the field.

This makes styling the captcha extra hard, since I have no way of 
differentiating it from other fields.

btw - thank you very much for a great app! :)

Original comment by ozkatz...@gmail.com on 20 Oct 2010 at 1:31