Recaptcha won't render using sfFormExtraPlugin and JQuery Dialog (lightbox)
Morning. 开发者_如何学PythonI have a form which is rendered inside of a jquery dialog box (lightbox) and currently trying to implement recaptcha as part of the form. Because I am using the symfony framework I am able to use the sfFormExtraPlugin which includes a recaptcha widget. This widget renders fine if I echo as part of the original page, but it will not render when inside the jquery dialog box.
After some investigating, I found the script that recaptcha creates looks similar to the following:
var RecaptchaState = {
site : '6Let7r0SAAAAAJFp77tW4gRze7r5y89Cql_msPcm',
challenge : '03AHJ_VusnO7jeI3VF-cHgOIv9RY9RIpYl2QWea_LULIdL8xrM9PZdcZZ7I9gFf4gSbr1fxGCSQjQZPJQ1sa6p1oEI9U_nkU8f2SjczxjH6nzmy43Q-m_8rnxWhhRUIDa7iTPEwo4-dwi-FipyMHsSAz-nE5yfFQfZog',
is_incorrect : false,
programming_error : '',
error_message : '',
server : 'http://www.google.com/recaptcha/api/',
timeout : 18000
};
document.write('<scr'+'ipt type="text/javascript" s'+'rc="' + RecaptchaState.server + 'js/recaptcha.js"></scr'+'ipt>');
I think the problem is the document.write, b/c the javascript is being invoked within the jquery dialog box vs the actual document, so the document.write won't work as expected.
Thoughts?
-- Edit --
Posted final solution on my blog, I would have posted here but it is fairly involved.
As mentioned in the edit of the OP, I was able to finally figure out a solution.
精彩评论