Hi there,
I'm trying to get working HTML::FormFu::Element::reCAPTCHA on a XHTML
1.1 Strict (tested also with 1.0 Transitional) site rendered using the
Catalyst::View::ContentNegotiation::XHTML. There is a bug somewhere
because when I switch from "normal" View:TT (see working.png) to the
XHTML View (see not-working.png), the reCAPTCHA element doesn't show up
though I haven't changed anything else.
The problem is on the reCAPTCHA's side becuase it seems that the XHTML
doctype is not supported
(
http://rickardandersson.com/recaptcha-and-xhtml and many more pages on
Google).
This is the element source YML:
- type: reCAPTCHA
name: recaptcha
public_key: [pubkey]
private_key: [privkey]
recaptcha_options:
custom_translations:
instructions_visual: Opište výše uvedená slova
instructions_audio: Napište, co jste slyšeli
visual_challenge: Zobrazit textovou verzi
audio_challenge: Poslechnout si zvukovou verzi (anglicky)
refresh_btn: Nemohu slova přečíst, vygenerovat nová
help_btn: Nápověda (anglicky)
cant_hear_this: Stáhnout nahrávku jako MP3
incorrect_try_again: Chyba. Zkuste to znovu
play_again: Přehrát nahrávku znovu
==> Older (without XHTML) view:
package Entropy::View::HTML;
use strict;
use utf8;
use base 'Catalyst::View::TT';
__PACKAGE__->config({
...
==> Newer (with XHTML) view:
package Entropy::View::HTML;
use strict;
use utf8;
use Moose;
use namespace::clean -except => 'meta';
extends 'Catalyst::View::TT';
with 'Catalyst::View::ContentNegotiation::XHTML';
__PACKAGE__->config({
...
==> Generated form source:
<div class="recaptcha constraint_recaptcha">
<span class="elements">
<script type="text/javascript">
//<![CDATA[
var RecaptchaOptions =
{"custom_translations":{"audio_challenge":"Poslechnout si zvukovou verzi
(anglicky)","cant_hear_this":"Stáhnout nahrávku jako
MP3","help_btn":"Nápověda (anglicky)","incorrect_try_again":"Chyba.
Zkuste to znovu","instructions_audio":"Napište, co jste
slyšeli","instructions_visual":"Opište výše uvedená
slova","play_again":"Přehrát nahrávku znovu","refresh_btn":"Nemohu slova
přečíst, vygenerovat nová","visual_challenge":"Zobrazit textovou verzi"}};
//]]>
</script>
<script src="
https://api-secure.recaptcha.net/challenge?k=[pubkey]"
type="text/javascript"></script>
<noscript><iframe frameborder="0" height="300"
src="
https://api-secure.recaptcha.net/noscript?k=[pubkey]"
width="500"></iframe><textarea cols="40"
name="recaptcha_challenge_field" rows="3"></textarea><input
name="recaptcha_response_field" type="hidden" value="manual_challenge"
/></noscript>
</span>
</div>
To confirm that there's clearly problem with the XHTML doctype, Firefox
reports this Exception when I open the site:
Error: uncaught exception: [Exception... "Operation is not supported"
code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"
location:
"
https://api-secure.recaptcha.net/challenge?k=6LcUTQgAAAAAAFKx0HJ1hBDR7ir2vfx3IEc%2dH3tp
Line: 12"]
This points to the reCAPTCHA service. Is there any possibility of fixing
this with some workaround? Should I stuck at plain HTML until it's fixed
in the reCAPTCHA API instead?