Simple registration form with two password fields to be copies each of another is shown on this demo.
Captions of wrongly filled fields are highlighted with orange colored font on form submit try
"E-mail", "Password" and "Password copy" fields are set to be required
"Name" field is checked to be filled with letters only, "Password" and "Password copy" are expected to contain alphanumeric (letters, digits and _) characters, "E-mail" field is checked to meet e-mail address pattern:
<a combination of alphanumeric chars, hyphens and dots>@<a combination of alphanumeric chars, hyphens and dots>.<from 2 to 4 letters>
Password copies are checked for exact match
This example uses free code from SoftComplex. Get it from the Tigra form validator page.