Have a solution for you here:
View source and grab the code.
Changed a few things like the submit and minor things in the script here and there (basically you were almost there).
The reason I took out the submit and replaced it with a button is because the page was reloading, that's not what you want since your looking for a straight DHTML solution. If you wish to submit the form then you can use a server-side language for that. The results will be the same but the page will reload everytime and you'll have to convert the existing code into another language. Asit is now, the first and last name isn't required if you are just going to display the costs and names ... since nothing is being submitted. The page is just responding dynamically and calculating based upon the fields, nothing more