In the tutorial you where looking at, it was a checkout page that had the action set to post to the confirm page.
rule number 1 when working with forms is:
All form Processing must happen on the action page.
in your case, the action of the form is not to post to another page, but instead it posts to itself, so the validation needs to be on the form page.