Ok, so I have a customer who used the Purchase Order form example in the forms manual to setup his own customized version of the same.
Everything works and displays correctly when viewing it on the web but when the user finishes the form and Forms saves it as a tiff inside Laserfiche it does not display the calculated item totals on the tif. I am pretty sure there is code out there already to trigger this before it's "printed" to laserfiche but I can't seem to get it right and/or find it.
Here's what we have at the moment:
$(document).ready(function () { $('.cf-table-block').on('blur', 'input', sumtotal); $('.tax').on('blur', 'input', sumtotal); $('.shipping').on('blur', 'input', sumtotal); sumtotal; }); function sumtotal() { var subtot = 0; $('.cf-table-block tbody tr').each(function () { var s = 0; s = parseNumber($(this).find('.price input').val()) * parseNumber($(this).find('.quantity input').val()); $(this).find('.subtotal input').val(parseFloat(s).toFixed(2)); subtot += s; }); grandTotal(subtot); } function parseNumber(n) { var f = parseFloat(n); //Convert to float number. return isNaN(f) ? 0 : f; //treat invalid input as 0; } function GetUserName() { var wshell = new ActiveXObject("WScript.Shell"); alert(wshell.ExpandEnvironmentStrings("%USERNAME%")); } function grandTotal(s) { var sum = 0; sum += s; sum += parseNumber($('.tax input').val()) + parseNumber($('.shipping input').val()); $('.total input').val(parseNumber(sum).toFixed(2)); }