This post was originally published at LionVineyard.com on 2009/10/30
Did you ever come across the situation of implementing reCAPTCHA, everything tested and working okay but after two days while doing more developments on the site it just does not want to validate anything anymore?
Where could the trap be?
Well, I was implementing reCAPTCHA on one of the sites I am involved, specifically on the WordPress comment form. Everything tested and verified, and left the aesthetics for last. By aesthetics I mean incorporating the <
fieldset > tag. Then I moved to further developments incorporating auto-notification of comment author upon reply to his comment. The next day reCAPTCHA would not validate.
My initial thought was that the auto-notification code hooks were conflicting with reCAPTCHA causing the error. I spend considerable amount of time chasing the problem around with no luck. Finally I decided to test it with the WordPress default theme. It would work – validate! Activating my custom theme, the validation time was over.
So where was the problem. I had one <
fieldset > tag outside the <
form > tag, a couple of line above it. Lost in the conditional statements within the Loop.
So if you are reCAPTCHA implementation stops working and you where doing aesthetics to the site, make sure to validate your HTML. It will show the problem and save you hours of bug chasing.
The W3C HTML Validation Service is the place to go…