The validation code should be added to the form action page.
If the action points to the thank you page, then the validation should be added to that page as well.
Go ahead and post links to your sample pages. That helps since I could look at the action instead of just telling you to.