Expand my Community achievements bar.

SOLVED

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

Avatar

Level 3

<% 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.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

4 Replies

Avatar

Level 10

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? 

Avatar

Level 3

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

Avatar

Correct answer by
Level 10

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

Avatar

Level 3

Adding 2 Captcha components onto a page  made it work.

 

Thanks