Recbox未显示为colorbox

时间:2013-07-23 09:43:22

标签: jquery colorbox

我在弹出框中使用colorbox jquery进行show registeration表单。

我使用以下脚本启动弹出窗口

<script type="text/javascript" language="javascript">

       $(".ajax").colorbox({width:"30%"});

</script>
在弹出窗口中,我用Recaptcha调用了注册表单。我可以在弹出框中获取所有表单字段但不能重新获取。

我得到的recptcha代码是带有noscript的ajax形式的recaptcha的地方

    <iframe src="http://www.google.com/recaptcha/api/noscript?k=6LdxveQSAAAAADjToPLUgHY6IRxJgreFWwwOF47H" height="300" width="500" frameborder="0"></iframe>
    <br/>
    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>

Popup box without recaptcha

没有ajax的实际注册表

actual regiestration form without ajax

1 个答案:

答案 0 :(得分:0)

弹出窗口中的Recaptcha可以通过以下代码完成  

<head>

<!-- ... your HTML  content ... -->

  <script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script>

  <!-- Wrapping the Recaptcha create method in a javascript function -->
  <script type="text/javascript">
     function showRecaptcha(element) {
       Recaptcha.create("your_public_key", element, {
         theme: "red",
         callback: Recaptcha.focus_response_field});
     }
  </script>

  <!-- ... more of your HTML  content ... -->

</head>

<body>

  <!-- ... your HTML <body> content ... -->

  <div id="recaptcha_div"></div>

  <input type="button" value="Show reCAPTCHA" onclick="showRecaptcha('recaptcha_div');"></input>

 <!-- ... more of your HTML  content ... -->

<body>

Google's details information about this problem

结果enter image description here