Also take a look at the following for a user-friendly addition for email address or password checking:
Verify / Notify for Duplicate Fields
Also keep in mind that the javascript might not work, so if you want to be extra sure that the two fields are the same, then you should check them in your back-end CGI.
In general, you should never rely on client-side processing to guarantee your data -- always check on the server where you have total control (but in this case, it might be overkill).