If it helps, it seems that the custom google search part is responsible for the problem.
Why? Because it creates another form, and forms within forms are according to HTML specs) strictly not allowed. The validator is inadvertently trying to get the settings for that google search form.
Solution: Move the google search part outside of your existing form.