i need to add the different captcha on the same page 2 times. | Community
Skip to main content
Level 3
October 16, 2015
Solved

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

  • October 16, 2015
  • 4 replies
  • 1229 views

<% 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.
Best answer by smacdonald2008

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

smacdonald2008
Level 10
October 16, 2015

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? 

Level 3
October 16, 2015

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

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

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

Level 3
October 16, 2015

Adding 2 Captcha components onto a page  made it work.

 

Thanks