How can I calculate the total cost in my form?