批量加入控件事件,哪错了

function init()
{

var f=document.forms[0];

var m;
for (var i=0;i<f.length;i++) {

var e=f.elements[i];
if (e.type=="text" && e.readOnly==false) {

eval('e.onBlur=FormatDecimalAsNumber(this)');
eval('e.onKeyPress=EnsureNumeric(event)');
}
}

}
在body中加入了onload="init();"
不起作用,哪错了
[400 byte] By [llpd] at [2008-1-9]
# 1
不要写在onload里,写在</html>后面

jf
Jialang-疯狂键盘 at 2007-9-30 > top of Msdn China Tech,.NET技术,ASP.NET...
# 2
请看下 eval('e.onBlur=FormatDecimalAsNumber(this)');有没错
lldszy-寂寞流星 at 2007-9-30 > top of Msdn China Tech,.NET技术,ASP.NET...
# 3
有人知道怎么做么
llpd at 2007-9-30 > top of Msdn China Tech,.NET技术,ASP.NET...
# 4
哪位大虾知道
llpd at 2007-9-30 > top of Msdn China Tech,.NET技术,ASP.NET...
# 5
哪位大虾知道
llpd at 2007-9-30 > top of Msdn China Tech,.NET技术,ASP.NET...