Sorry, I've given you some incorrect information...
Templates (HTML or Plain) for sending the email can, obviously, refer to fields on the form using $fieldname.
A template for good_template can also refer to fields using $fieldname.
However, templates for displaying errors (bad_template) cannot reference fields this way.
They have tags to show the error and include sensible error messages (<fmerror />, etc), but they cannot show the value of a field.
The reason for this is simply that the error might (and typically will) be that the user has failed to enter data into the field you're showing.
In your case, the displayed template will look a little strange if the user has not entered either their first or last name.
In your case, you want this in your form:
and in the template you want this:
<input type="hidden" name="required" value="email=email2:Email addresses must match">
This will show the basic error message and a bulleted list of the fields that were not correct.
The form required some values that you did not seem to provide.
- Email addresses must match