Recaptcha in modal window (fancybox)

I am trying to upload a form via ajax inside fancybox. It works great, everything works fine.

I used the recaptcha (rails) plugin and got the captcha in the form. Now, when fancybox loads, it redirects to a blank page, only clicks on it.

I assume this is some problem with iframe and modal window?

Has anyone loaded recaptcha in the form inside fancybox? would help me if you could give me an example.

appreciate your help ...

+3
source share
4 answers
+5

, Safari (, Chrome ). Firefox. Ruby ( Grails), jQuery ( blockUI, SimpelModal ThickBox).

, - , jQuery iframe ( , ReCaptcha) domtree, Webkit iframe . , , iframe.

, Webkit, , .

: :

$('#captcha-form script').remove();

'captcha-form' - , . script, , Safari jQuery. , script, script, .

, Safari javascript, . . , , document.write, recaptcha, , .

0

- , recaptcha, fancybox, iframe

:

<script>
$(document).ready(function() {
     $(".example").fancybox({
          fitToView   : true,
          autoSize    : false,
          openEffect  : 'elastic',
          closeEffect : 'elastic'
     });
});
</script>

HTML

<a href="http://url.com/iframe" class="example fancybox.iframe>Captcha Fancybox</a>

, fancybox, - :

$.fancybox({
     width        : '520px',
     height       : '230px',
     autoSize     : false,
     openEffect   : 'elastic',
     closeEffect  : 'elastic',
     'href'       : 'http://www.url.cc',
     type         : 'iframe'
  });
0
source

A simple solution to upload a form using recaptcha via ajax in fancybox.

<%= recaptcha_tags ajax: true %> 
0
source

Source: https://habr.com/ru/post/1762335/


All Articles