Skip to main content
Level 3
Oct 16, 2015 2:29 AM UTC
Solved

i need to add the different captcha on the same page 2 times.

<% if(captchaNode!=null) { String captchaPath= "/content/captcha"; %>
                 <sling:include  path="<%= captchaPath %>" resourceType="foundation/components/form/captcha" replaceSelectors="captcha"/>
            <% } %>
            
            <% if(captchaNode!=null) { String captchaPath= "/content/captcha_reply"; %>
                 <sling:include  path="<%= captchaPath %>" resourceType="foundation/components/form/captcha" replaceSelectors="captcha"/>
            <% } %>

Now on adding the above  that I see that it adds in the same page  2 times the same id "cq_captchaimg"  below is the  html sinnpet 
generated.
<div class="form_captcha_img">
<img id="cq_captchaimg" alt="" src="/content/captcha.captcha.png?id=123">
</div>

Please let me what are changes i must do to reslove it.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:29 AM UTC

Did you try dropping 2 ootb Captcha components onto a page? 

If you do not want to use ootb component - here is a good article on using a Google component (recaptcha):

http://wcmaem.blogspot.ca/2014/12/google-recaptcha-integration-with-adobe.html

https://www.google.com/recaptcha/intro/index.html

4 replies

Level 3
Oct 16, 2015 2:29 AM UTC

Adding 2 Captcha components onto a page  made it work.

 

Thanks

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:29 AM UTC

Did you try dropping 2 ootb Captcha components onto a page? 

If you do not want to use ootb component - here is a good article on using a Google component (recaptcha):

http://wcmaem.blogspot.ca/2014/12/google-recaptcha-integration-with-adobe.html

https://www.google.com/recaptcha/intro/index.html

Translate
Level 3
Oct 16, 2015 2:29 AM UTC

Yes , I want to add 2 captcha on the same page.

use case:-

I have a comment section where captcha has to be displayed to the user which filling/posting the comment and on the reply section also we need an captcha. Please let me know how to proceed

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:29 AM UTC

Can you please explain your use case in more detail. You want to add 2 of these components to a single page - is that correct? 

Translate