我创建了一个用于计算每月费用的表单。我遇到的问题是我收集前一页(会话到数据)的信息的最后一页,该信息自动填充最后一页上的字段。我创建了一个JavaScript,假设总页数减去五个字段,但这不起作用。如果我将会话从加载部分删除数据,JavaScript完美地工作。Javascript页面加载总数
页的问题: http://www.garranteedsolutions.com/budget?chronoform=BudgetPage7
的Javascript:
window.addEvent('domready', function() {
$('spendable').addEvent('change', rekenen1);
$('housetotal').addEvent('change', rekenen1);
$('cartotal').addEvent('change', rekenen1);
$('creditortotal').addEvent('change', rekenen1);
$('misctotal').addEvent('change', rekenen1);
});
function rekenen1(){
$('grandtotal').value = Number($('spendable').value) + Number($('housetotal').value) + Number($('cartotal').value) + Number($('creditortotal').value) + Number($('misctotal').value) ;
}
这是我一直在使用的代码,但它需要在表格框的改变要执行的操作。我已经试过这
的Javascript:
window.addEvent('domready', function() {
rekenen1;
$('spendable').addEvent(rekenen1);
$('housetotal').addEvent(rekenen1);
$('cartotal').addEvent(rekenen1);
$('creditortotal').addEvent(rekenen1);
$('misctotal').addEvent(rekenen1);
});
function rekenen1(){
$('grandtotal').value =
Number($('spendable').value) + Number($('housetotal').value)
+ Number($('cartotal').value) + Number($('creditortotal').value)
+ Number($('misctotal').value);
}
这是我的延续寻求帮助,从这里开始:http://www.chronoengine.com/forums/viewtopic.php?f=2&t=67427&p=269741#p269741
我不知道的Javascript非常好,我很接近完成此表格。我只是无法让Grand Total合计。
这不起作用。控制台说以下内容: '未捕获的ReferenceError:refenen1没有定义 rokboxPathbudget:76 (匿名功能)的mootools-core.js:370 hmootools-core.js:33个 Array.implement.eachmootools核。 js:39 invoke.fireEventmootools-core.js:369 g' 我需要将只读关掉吗?我真的很想这样,最终用户不能改变总数。 – 2012-03-18 19:13:16
它称为rekenen1的函数不是refenen1。我认为你拼错了这个名字 – ajimix 2012-03-19 13:29:13