@@ -51,8 +51,8 @@ You can pass some parameters into the widget contructor:
51
51
52
52
``` python
53
53
class ReCaptchaWidget (Widget ):
54
- def __init__ (self , explicit = False , theme = None , type = None , size = None , tabindex = None , callback = None ,
55
- expired_callback = None , attrs = {}, * args , ** kwargs ):
54
+ def __init__ (self , explicit = False , container_id = None , theme = None , type = None , size = None , tabindex = None ,
55
+ callback = None , expired_callback = None , attrs = {}, * args , ** kwargs ):
56
56
```
57
57
58
58
If you set the explicit boolean to true, you will render this field with explicit render support. This is useful if you
@@ -62,6 +62,18 @@ You can personalize reCaptcha theme, type, size, tabindex, callback and expired_
62
62
<a href =" https://developers.google.com/recaptcha/docs/display#config " >documentation</a > if you want to change those values.
63
63
Warning: the app doesn't validate the incoming parameter values.
64
64
65
+ ### Recaptcha "container id"
66
+ Now the default container id for the recaptcha is:
67
+
68
+ * recaptcha-{$fieldname} for the automatic rendering
69
+ * recaptcha-{$fieldname}-{%fiverandomdigits} for the explicit rendering
70
+
71
+ This avoids name collisions when you use multiple instances of the recaptcha in different forms, but in the same page
72
+ and with the same field name.
73
+
74
+ ** Note:** you can always override the container id with the "container_id" argument in the widget constructor, but take
75
+ care: nobody will check if the id you provide is already used.
76
+
65
77
### Templating
66
78
You can use some template tags to simplify the reCaptcha adoption:
67
79
0 commit comments