First you should create a standard html form, then, in the description of each field which modify the price, you add an "onChange" event listener which calls a javascript function that calculates the price. <onChange="javascript:calculate()"> something like that.
Fields can be accessed as objects, retrieve their value using the "value" member variable, then adapt the price.
Here is what your calculate() function looks like:
function calculate {
int sum = 0;
if( <document>.<formname>.<fieldname>.value == x )
{
sum += 30;
}
if( <document>.<formname>.<fieldname>.value == y)
{
sum += 20;
}
.... continue till the end and finally update the price
<document>.<formname>.<fieldprice>.value = sum;
}