Javascript based calculated field algorithm builder.
With this algorithm the user can implement it's own algorithm directly in
javascript and directly inside the form definition.
The syntax is as follows:
<fd:value type="javascript" triggers="items,price,discount">
var price = parent.lookupWidget('price').getValue();
var items = parent.lookupWidget('items').getValue();
var discount = parent.lookupWidget('discount').getValue();
if (discount == 'completelyfree') return 0;
var total = price * items;
if (discount == 'halfprice') return total / 2;
return total;
</fd:value>
From inside the javascript function the following objects are accessible: