are you validating clientside or serverside?
If serverside, the input elements names form the $elementname variable in PHP.
What I do for this is to create a function that shows the form and each element has a value called $elementname:
<input type =text name = firstname value = "$firstname">
when the function is called and the form is opened for the first time, all the $elementnames are blank, resulting in empty fields...if the form was submitted and one of the elements caused a failure, then the form will show with the vairables filled in...
This is a great way of not pissing off your users by making them reenter the info...
Bastien