Could not find a related post so here goes. Base form to be filled out by end user requesting travel has a table static with 9 rows and 3 columns.
We want the Estimated Expense column (required) to be displayed on the first form to the end user. All three columns (Source columns to be required if there is a value in the associated expense column) to be displayed on the second form presented to the Site Administrator during the approval process.
Any ideas on how to do this? I was thinking about js based on CSS class assigned to the columns but I am not sure what the code should be.
The current code that I am using for calculating totals and such is the following:
$(document).ready(function() {
$('.Submit').hide();
$(document).on('blur change', '.estExpns input', esttotal);
});
// Table Sumations
function parseNumber(n) {
var f = parseFloat(n); //Convert to float number.
return isNaN(f) ? 0 : f; //treat invalid input as 0;
};
function esttotal() {
var s = 0;
$('.estExpns input').each(function () {
s += parseNumber($(this).val());
});
$('.estTotal input').val(s);
};
I am open to any ideas, Thank you in advance.