Hey @brettlewis, sure! So that would look like this.
Here are the expansion pack instructions.
-
Add a Decision Box field and add the CSS Classes math-input include-vat
-
Add the following to the code
if($('.include-vat input')[0].checked){ calc = calc * 1.2; }
So the result in my example looks like this.
TB.render('component_3',function(){
var calculateAndUpdateDom = function(){
var amountInput = $('.amount input').val();
var quantityAmount = $('.quantity input').val();
var calc = amountInput * quantityAmount;
if($('.include-vat input')[0].checked){
calc = calc * 1.2;
}
$('#total').html('$'+calc);
};
$('.math-input').on('keyup change',function(){
calculateAndUpdateDom();
});
});

