Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cannot call javascript File through FireFox and Chrome?
- function CalculateTEF() {
- alert('Test');
- var total = 0;
- var tbTotalEstFunds = getServerObject('text123');
- var table = getServerObject('TEF');
- for(var i = 0; i < table.rows.length - 1; i++) {
- var row = table.rows(i);
- if(row.cells(1) == null) continue;
- if(row.cells(1).getElementsByTagName('input') == null) continue;
- var tbAmount = row.cells(1).getElementsByTagName('input');
- if(tbAmount.length == 0 || tbAmount[0].value.trim().length == 0) {
- continue;
- }
- var amount = parseFloat(tbAmount[0].value.replace(/,/g, ''));
- if(isNaN(amount)) {
- tbTotalEstFunds.value = 'error';
- return;
- }
- total += amount;
- }
- tbTotalEstFunds.value = FormatNumber(total, 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment