I am currently utilizing the reCAPTCHA AJAX API to showcase the captcha in a modal dialog box. To display the boxes, I am incorporating jqModal, and opting for the AJAX version of reCAPTCHA due to compatibility issues with the PHP version when used with jqModal (a known bug: ).
While reCAPTCHA functions smoothly in Firefox, I have encountered issues with its display in Safari. At times it functions correctly, but approximately 20% of the time, the reCAPTCHA box fails to appear.
The jqModal declaration is structured as follows:
$().ready(function() {
$('#modalBox_register').jqm({
ajax: '/modals/register.php',
trigger: 'a#registerButtonLink',
onShow: function(h) {
h.w.css('opacity', 1.00).fadeIn(300);
},
onHide: function(h) {
h.w.fadeOut(300, function() { if (h.o) h.o.remove(); });
}
});
});
Within the modal box, the HTML/PHP content is outlined as below:
<div id="registerModal">
<p class="caption">Registration form:</p>
<form name="registerForm" id="modalRegisterForm" class="modalForm" action="/register/" method="post">
<table cellspacing="15" border="0">
<tr>
<td class="left"><label for="firstName">First Name:</label></td>
<td class="right"><input type="text" name="firstName" id="firstName" value="" class="registerModalTextField" /></td>
</tr>
<tr>
<td class="left"><label for="lastName">Last Name:</label></td>
<td class="right"><input type="text" name="lastName" id="lastName" value="" class="registerModalTextField" /></td>
</tr>
<tr>
<td class="left"><label for="email">Email Address:</label></td>
<td class="right"><input type="text" name="email" id="email" value="" class="registerModalTextField" /></td>
</tr>
<tr>
<td class="left"><label for="password">Password:</label></td>
<td class="right"><input type="password" name="password" id="password" value="" class="registerModalTextField" /></td>
</tr>
<tr>
<td class="left"><label for="passwordConfirm">Confirm Your Password:</label></td>
<td class="right"><input type="password" name="passwordConfirm" id="passwordConfirm" value="" class="registerModalTextField" /></td>
</tr>
<tr>
<td class="left"> </td>
<td class="right"><div id="termswrap">
<input id="terms" type="checkbox" name="terms" />
<label id="lterms" for="terms"> I have read and accept the <a href="/backmatter/termsofuse/">Terms of Use.</a><br /></label>
</div><!-- /#termswrap --></td>
</tr>
<!-- reCAPTCHA -->
<tr>
<td class="left"><label for="captcha">Are you human?</label></td>
<td class="right"><!-- Utilizing the reCAPTCHA AJAX API to address compatibility issues with jqModal -->
<div id="recaptcha_div"></div>
<script type="text/javascript"
src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script> <script
type="text/javascript">
Recaptcha.create("123456789...",
"recaptcha_div", {
theme: "white"
});
</script>
</td>
</tr>
<tr>
<td class="left"> </td>
<td class="right"><input type="image" id="submitButton" src="/images/modals/button_register.png" value="Submit" alt="Submit" name="submit" /></td>
</tr>
</table>
</form>
</div><!--/#registerModal-->
Is there any insight into the root cause of the reCAPTCHA AJAX issue specifically affecting Safari?