Calculating HTML Forms
This is a topic that I find people are looking to do all the time. Here is a solution that works and is fairly simple. This even takes into account that you might want to maintain the text value of the field option to place into your database.