Hello, I'm a php guy and I'm pretty much terrible with javascript. I've setup a form validation script and it's working well.

When a form field doesn't meet my criteria, the given field takes the focus. This is the good part.

The bad part is the form field with focus is at the very very top of the browser page (both IE and Firefox). The error message (a div that is triggered when the validation detects an error) is not visible. I have to scroll up to see the text.

This is VERY unintuitive and it really needs to be fixed for the validation to be user friendly.

My site is in the final stages of development. I've got a feeling that I've got a margin set in my CSS that is making the focus go all the way to the top of the page. I could be wrong.

How do I format the focus so that it displays towards the center of the page exposing my error message?