How can I create/add custom javascript to a form to calculate fields?