views:

722

answers:

5

I want to have a Recaptcha on a JQuery Dialog. Though the line

$("#newsletterDialog").dialog({ 
    autoOpen: true, 
    modal: false, 
    resizable: false, 
    draggable: false, 
    width: 400 
})

Will break jquery, so that

validator.Challenge = Context.Request.Form[RECAPTCHA_CHALLENGE_FIELD];

fails (I.e. some operation with a hidden field foes wrong). In addition Firefox is hanging, so I cant debug the way I am used to (I think that's not just because of that line).

Any clues?

A: 

obviously if your javascript is being broken by your dialog then any subsequent javascript will not work later on your page. Try using a try/catch block around your dialog.

hunter
A: 

obviously if your javascript is being broken by your dialog then any subsequent javascript >will not work later on your page. Try using a try/catch block around your dialog

What I meant was that Firefox seems to have some extra problems. In Chrome and IE it is the dialog-line that breaks the Captcha. (I don't think you can say that the dialog is breaking JavaScript later on the page, and I have no idea where you think I should put a try/catch).

It is quite similar to the issues in this thread: http://groups.google.com/group/recaptcha/browse_thread/thread/60cae6c9d3144269 (I have about the same Firefox messages)

Will look at the solutions tomorrow.

A: 

It seems the specific Firefox issues were solved by not having

$("#newsletterDialog").dialog inside    $(document).ready(function())

(I.e it is executed immediately instead of in a later event )

A: 

OK - remove SOF

http://fr.vivat.be/newsleSOFtter/ipNLDialogtest.aspx (not working)

http://fr.vivat.be/newSOFsletter/ipNLDialogtest_NOT_JQUERY.aspx (working without the call)

(Seems my change didn't really fix the additional Firefox problems, can be a timing thing)

A: 

I think the best solution is an iframe with the captcha-code inside the dialog DIV. It makes some programming more difficult though (Having to go up to the parent document).

Olav