@@ -51,8 +51,8 @@ You can pass some parameters into the widget contructor:
5151
5252``` python
5353class 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 ):
5656```
5757
5858If 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_
6262<a href =" https://developers.google.com/recaptcha/docs/display#config " >documentation</a > if you want to change those values.
6363Warning: the app doesn't validate the incoming parameter values.
6464
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+
6577### Templating
6678You can use some template tags to simplify the reCaptcha adoption:
6779
0 commit comments