google-code-export / django-simple-captcha

Automatically exported from code.google.com/p/django-simple-captcha
MIT License
0 stars 0 forks source link

CSS class to the widget #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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